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

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

Change subject: UploadWizardUploadInterface: Remove some broken dead code
......................................................................

UploadWizardUploadInterface: Remove some broken dead code

* mw.UploadWizardUploadInterface.prototype.resetFileInput.
  This function does nothing. You can't modify the 'value'
  of a <input type="file">. Removed functions and all calls.

* mw.UploadWizardUploadInterface.prototype.hideFileInput.
  Simply unused. Also remove a misleading comment about it.

* A check for `!this.$fileInputCtrl.first().value`. This is
  always undefined, because first() returns a jQuery object.

Change-Id: I21538e013878eb2b9cba024005b1f420f8cd3ce2
---
M resources/mw.UploadWizard.js
M resources/mw.UploadWizardUpload.js
M resources/mw.UploadWizardUploadInterface.js
3 files changed, 1 insertion(+), 23 deletions(-)


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

diff --git a/resources/mw.UploadWizard.js b/resources/mw.UploadWizard.js
index fc97084..64376a2 100644
--- a/resources/mw.UploadWizard.js
+++ b/resources/mw.UploadWizard.js
@@ -278,7 +278,6 @@
 
                                        if ( tooManyFiles ) {
                                                
wizard.steps.file.showTooManyFilesWarning( totalFiles );
-                                               upload.resetFileInput();
                                                return;
                                        }
 
diff --git a/resources/mw.UploadWizardUpload.js 
b/resources/mw.UploadWizardUpload.js
index 2f71d62..8e151e2 100644
--- a/resources/mw.UploadWizardUpload.js
+++ b/resources/mw.UploadWizardUpload.js
@@ -99,13 +99,6 @@
        };
 
        /**
-        * Reset file input.
-        */
-       mw.UploadWizardUpload.prototype.resetFileInput = function () {
-               this.ui.resetFileInput();
-       };
-
-       /**
         * start
         *
         * @return {jQuery.Promise}
diff --git a/resources/mw.UploadWizardUploadInterface.js 
b/resources/mw.UploadWizardUploadInterface.js
index a77979e..a494232 100644
--- a/resources/mw.UploadWizardUploadInterface.js
+++ b/resources/mw.UploadWizardUploadInterface.js
@@ -271,13 +271,6 @@
        };
 
        /**
-        * Reset file input to have no value.
-        */
-       mw.UploadWizardUploadInterface.prototype.resetFileInput = function () {
-               this.$fileInputCtrl.get( 0 ).value = '';
-       };
-
-       /**
         * Get a list of the files from this file input, defaulting to the 
value from the input form
         *
         * @return {Array} of File objects
@@ -285,7 +278,7 @@
        mw.UploadWizardUploadInterface.prototype.getFiles = function () {
                var files = [];
                if ( mw.fileApi.isAvailable() ) {
-                       if ( this.providedFile && 
!this.$fileInputCtrl.first().value ) {  // default to the fileinput if it's 
defined.
+                       if ( this.providedFile ) {
                                files[ 0 ] = this.providedFile;
                        } else {
                                $.each( this.$fileInputCtrl.get( 0 ).files, 
function ( i, file ) {
@@ -531,7 +524,6 @@
                                $win.off( 'resize', onResize );
                        };
                }
-               // Show file input (possibly hidden by .hideFileInput())
                this.$fileInputCtrl.show();
                update();
        };
@@ -541,12 +533,6 @@
                        this.stopTracking();
                        this.stopTracking = null;
                }
-       };
-
-       mw.UploadWizardUploadInterface.prototype.hideFileInput = function () {
-               this.cancelPositionTracking();
-               // Hide file input so it does not interfere with other 
interface elements
-               this.$fileInputCtrl.hide();
        };
 
        /**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I21538e013878eb2b9cba024005b1f420f8cd3ce2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to