| Index: ui/file_manager/gallery/js/gallery_data_model.js
|
| diff --git a/ui/file_manager/gallery/js/gallery_data_model.js b/ui/file_manager/gallery/js/gallery_data_model.js
|
| index b9921baa39190843975ff86ad86e6f040a78bbed..0d5d353e3512c98aa18ad514d6c8b381578053de 100644
|
| --- a/ui/file_manager/gallery/js/gallery_data_model.js
|
| +++ b/ui/file_manager/gallery/js/gallery_data_model.js
|
| @@ -30,6 +30,8 @@ function GalleryDataModel(metadataModel, opt_watcher) {
|
| // Start to watch file system entries.
|
| var watcher = opt_watcher ? opt_watcher : new EntryListWatcher(this);
|
| watcher.getEntry = function(item) { return item.getEntry(); };
|
| +
|
| + this.addEventListener('splice', this.onSplice_.bind(this));
|
| }
|
|
|
| /**
|
| @@ -152,3 +154,17 @@ GalleryDataModel.prototype.evictCache = function() {
|
| }
|
| }
|
| };
|
| +
|
| +/**
|
| + * Handles entry delete.
|
| + * @param {!Event} event
|
| + * @private
|
| + */
|
| +GalleryDataModel.prototype.onSplice_ = function(event) {
|
| + if (!event.removed || !event.removed.length)
|
| + return;
|
| + var removedURLs = event.removed.map(function(item) {
|
| + return item.getEntry().toURL();
|
| + });
|
| + this.metadataModel_.notifyEntriesRemoved(removedURLs);
|
| +};
|
|
|