adapt-authoring-ui 1.8.0 → 1.8.1
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.
|
@@ -50,7 +50,8 @@ define(function(require){
|
|
|
50
50
|
'assetManagement:sidebarFilter:remove': this.removeFilter,
|
|
51
51
|
'assetManagement:sidebarView:filter': this.filterBySearchInput,
|
|
52
52
|
'assetManagement:assetManagementSidebarView:filterByTags': this.filterByTags,
|
|
53
|
-
'assetManagement:collection:refresh': this.resetCollection
|
|
53
|
+
'assetManagement:collection:refresh': this.resetCollection,
|
|
54
|
+
'assetManagement:assetPreviewView:delete': this.onAssetDeleted
|
|
54
55
|
});
|
|
55
56
|
},
|
|
56
57
|
|
|
@@ -186,6 +187,12 @@ define(function(require){
|
|
|
186
187
|
this.fetchCollection();
|
|
187
188
|
},
|
|
188
189
|
|
|
190
|
+
onAssetDeleted: function(assetId) {
|
|
191
|
+
if (!assetId) return;
|
|
192
|
+
this.allAssets = this.allAssets.filter(asset => asset.get('_id') !== assetId);
|
|
193
|
+
$('.asset-management-no-assets').toggleClass('display-none', this.allAssets.length > 0);
|
|
194
|
+
},
|
|
195
|
+
|
|
189
196
|
// Event handling
|
|
190
197
|
|
|
191
198
|
onResize: function() {
|
|
@@ -51,7 +51,7 @@ define(function(require){
|
|
|
51
51
|
try {
|
|
52
52
|
await $.ajax({ url: `api/assets/${this.model.get('_id')}`, type: 'DELETE' });
|
|
53
53
|
this.model.trigger('destroy', this.model, this.model.collection);
|
|
54
|
-
Origin.trigger('assetManagement:assetPreviewView:delete');
|
|
54
|
+
Origin.trigger('assetManagement:assetPreviewView:delete', this.model.get('_id'));
|
|
55
55
|
this.remove();
|
|
56
56
|
} catch(e) {
|
|
57
57
|
Origin.Notify.alert({
|
package/package.json
CHANGED