Clear all gallery state on teardown

Change-Id: I90662d02bd2d9768bdcf27e532ed8b8792f764c3
This commit is contained in:
Ed Sanders 2017-06-30 13:35:30 +01:00 committed by Jforrester
parent 12f681a19d
commit 915e818356

View file

@ -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 );