Esanders has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/362417 )

Change subject: Clear all gallery state on teardown
......................................................................

Clear all gallery state on teardown

Change-Id: I90662d02bd2d9768bdcf27e532ed8b8792f764c3
---
M modules/ve-mw/ui/dialogs/ve.ui.MWGalleryDialog.js
1 file changed, 7 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor 
refs/changes/17/362417/1

diff --git a/modules/ve-mw/ui/dialogs/ve.ui.MWGalleryDialog.js 
b/modules/ve-mw/ui/dialogs/ve.ui.MWGalleryDialog.js
index 2ca281b..77d54e9 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.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 );
@@ -443,6 +448,7 @@
  * Request the images for the images tab panel menu
  *
  * @param {Object} options Options for the request
+ * @return {jQuery.promise} Promise which resolves when image data has been 
fetched
  */
 ve.ui.MWGalleryDialog.prototype.requestImages = function ( options ) {
        var i, len,

-- 
To view, visit https://gerrit.wikimedia.org/r/362417
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I90662d02bd2d9768bdcf27e532ed8b8792f764c3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Esanders <esand...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to