Bartosz Dziewoński has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/270294

Change subject: UploadWizardUploadInterface: Hide the "Show thumbnail" button 
only after showing thumbnail
......................................................................

UploadWizardUploadInterface: Hide the "Show thumbnail" button only after 
showing thumbnail

Previously: the button disappeared after the file was stashed, even if
the thumbnail wasn't being displayed (if many large files were added
at once and UploadWizardUpload#disablePreview was called earlier).
It went disabled when clicked.

Now: the button disappears when it is clicked and the thumbnail
appears, and never otherwise.

Bug: T126728
Change-Id: Iac80b00b3dea1e48dd45fa5f80b1d803142fb7cb
---
M resources/mw.UploadWizardUploadInterface.js
1 file changed, 6 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard 
refs/changes/94/270294/1

diff --git a/resources/mw.UploadWizardUploadInterface.js 
b/resources/mw.UploadWizardUploadInterface.js
index a494232..43cf415 100644
--- a/resources/mw.UploadWizardUploadInterface.js
+++ b/resources/mw.UploadWizardUploadInterface.js
@@ -220,10 +220,6 @@
        mw.UploadWizardUploadInterface.prototype.showStashed = function () {
                this.$fileInputCtrl.detach();
 
-               if ( this.$showThumbCtrl ) {
-                       this.$showThumbCtrl.detach();
-               }
-
                this.showIndicator( 'stashed' );
                this.setStatus( 'mwe-upwiz-stashed-upload' );
                this.setAdditionalStatus( null );
@@ -371,12 +367,17 @@
         * Display thumbnail preview.
         */
        mw.UploadWizardUploadInterface.prototype.showThumbnail = function () {
-               var $preview = $( this.div ).find( '.mwe-upwiz-file-preview' );
+               var
+                       $preview = $( this.div ).find( 
'.mwe-upwiz-file-preview' ),
+                       $showThumbCtrl = this.$showThumbCtrl;
                this.upload.getThumbnail(
                        mw.UploadWizard.config.thumbnailWidth,
                        mw.UploadWizard.config.thumbnailMaxHeight
                ).done( function ( thumb ) {
                        mw.UploadWizard.placeThumbnail( $preview, thumb );
+                       if ( $showThumbCtrl ) {
+                               $showThumbCtrl.remove();
+                       }
                } );
        };
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iac80b00b3dea1e48dd45fa5f80b1d803142fb7cb
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński <matma....@gmail.com>

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

Reply via email to