From 915e818356920b41ca76966ca78f74920bfff2d3 Mon Sep 17 00:00:00 2001 From: Ed Sanders Date: Fri, 30 Jun 2017 13:35:30 +0100 Subject: [PATCH] Clear all gallery state on teardown Change-Id: I90662d02bd2d9768bdcf27e532ed8b8792f764c3 --- modules/ve-mw/ui/dialogs/ve.ui.MWGalleryDialog.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/ve-mw/ui/dialogs/ve.ui.MWGalleryDialog.js b/modules/ve-mw/ui/dialogs/ve.ui.MWGalleryDialog.js index 2ca281be58..a131e7dc41 100644 --- a/modules/ve-mw/ui/dialogs/ve.ui.MWGalleryDialog.js +++ b/modules/ve-mw/ui/dialogs/ve.ui.MWGalleryDialog.js @@ -408,11 +408,16 @@ ve.ui.MWGalleryDialog.prototype.getReadyProcess = function ( data ) { ve.ui.MWGalleryDialog.prototype.getTeardownProcess = function ( data ) { return ve.ui.MWGalleryDialog.super.prototype.getTeardownProcess.call( this, data ) .first( function () { + // Widgets this.galleryGroup.clearItems(); - this.highlightedItem = null; this.searchWidget.getQuery().setValue( '' ); this.searchWidget.teardown(); + + // States + this.highlightedItem = null; this.searchPanelVisible = false; + this.selectedFilenames = {}; + this.initialImageData = []; // Disconnect events this.indexLayout.disconnect( this );