Neilk has uploaded a new change for review. https://gerrit.wikimedia.org/r/163235
Change subject: fix spurious upload uis being created ...................................................................... fix spurious upload uis being created Fixes bug 70429 Bugzilla: https://bugzilla.wikimedia.org/show_bug.cgi?id=70429 Change-Id: I84ede8ac609f85a0118a0baba00955d9041fa42c remove uploadToAdd when looping to beginning Change-Id: Ie2e10ab79d8e1c922c28aa2fc030439c7e45e788 --- M resources/mw.UploadWizard.js M resources/mw.UploadWizardUpload.js 2 files changed, 10 insertions(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard refs/changes/35/163235/1 diff --git a/resources/mw.UploadWizard.js b/resources/mw.UploadWizard.js index d45936b..220e258 100644 --- a/resources/mw.UploadWizard.js +++ b/resources/mw.UploadWizard.js @@ -56,6 +56,8 @@ $.purgeReadyEvents(); $.purgeSubscriptions(); this.removeMatchingUploads( function () { return true; } ); + $( this.uploadToAdd.ui.div ).remove(); + delete this.uploadToAdd; this.moveToStep( 'file' ); }, @@ -458,7 +460,9 @@ this.uploadToAdd = upload; // we explicitly move the file input to cover the upload button - upload.ui.moveFileInputToCover( '#mwe-upwiz-add-file', 'poll' ); + if (typeof providedFile === 'undefined') { + upload.ui.moveFileInputToCover( '#mwe-upwiz-add-file', 'poll' ); + } // we bind to the ui div since unbind doesn't work for non-DOM objects $( upload.ui.div ).bind( 'filenameAccepted', function (e) { @@ -480,9 +484,6 @@ */ setUploadFilled: function ( upload ) { var wizard = this; - - // Create new upload slot for additional upload(s) - this.newUpload(); // When we add uploads from a multi-select operation, the file objects // may be filled in random order, because filling them depends on @@ -921,7 +922,6 @@ this.allowCloseWindow(); } - this.resetFileStepUploads(); this.moveToStep( 'file' ); } diff --git a/resources/mw.UploadWizardUpload.js b/resources/mw.UploadWizardUpload.js index 5da5b1f..3a968f9 100644 --- a/resources/mw.UploadWizardUpload.js +++ b/resources/mw.UploadWizardUpload.js @@ -564,6 +564,11 @@ upload.wizard.newUpload( file, upload.reservedIndex + i + 1 ); } ); this.wizard.updateFileCounts(); + } else { + // this must be the last file + // so, add last upload, which is empty, and the file input will be + // placed over the add more files button + this.wizard.newUpload(); } } else { this.filename = filename; -- To view, visit https://gerrit.wikimedia.org/r/163235 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie2e10ab79d8e1c922c28aa2fc030439c7e45e788 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/UploadWizard Gerrit-Branch: master Gerrit-Owner: Neilk <[email protected]> _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
