adapt-authoring-ui 3.0.3 → 3.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -32,8 +32,10 @@ define([
32
32
  },
33
33
 
34
34
  updateTitle: function(e) {
35
- if(!this.form.fields.title.getValue()) { // add the asset file name if there isn't already a title
36
- this.form.fields.title.setValue($(e.currentTarget).val().replace("C:\\fakepath\\", ""));
35
+ const value = $(e.currentTarget).val();
36
+ this.$('.asset-thumb').toggle(!value);
37
+ if(value && !this.form.fields.title.getValue()) {
38
+ this.form.fields.title.setValue(value.replace("C:\\fakepath\\", ""));
37
39
  }
38
40
  },
39
41
 
@@ -70,12 +72,14 @@ define([
70
72
  });
71
73
  }
72
74
  const newData = await Helpers.submitForm(this.form, {
73
- method: model.isNew() ? 'POST' : 'PATCH',
75
+ method: model.isNew() ? 'POST' : 'PATCH',
74
76
  url: model.url(),
75
77
  beforeSubmit: this.sanitiseData
76
78
  });
77
79
  const _id = newData && newData._id;
78
80
 
81
+ if(newData) this.model.set(newData);
82
+
79
83
  if(this.model.get('isModal')) {
80
84
  if(_id) Origin.trigger('assetManagement:collection:refresh', null, true, _id);
81
85
  Origin.trigger('assetManagement:modalEdit:remove');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adapt-authoring-ui",
3
- "version": "3.0.3",
3
+ "version": "3.0.4",
4
4
  "description": "Front-end application for the Adapt authoring tool",
5
5
  "homepage": "https://github.com/adapt-security/adapt-authoring-ui",
6
6
  "license": "GPL-3.0",