Bartosz Dziewoński has uploaded a new change for review. https://gerrit.wikimedia.org/r/237307
Change subject: Unbreak final "Continue anyway" button on 'Details' step ...................................................................... Unbreak final "Continue anyway" button on 'Details' step * Correctly re-emit 'finalize-details-after-removal' event, otherwise clicking on it did nothing. Follow-up to 3f1000a86b47376d8887ffa0e474c744d28c0e9c. * Remove dead code trying to remove non-existent "thanksDiv". * Modify mw.UploadWizard#uploads in-place, otherwise the 'Thanks' step would still display the newly removed files. Follow-up to 544eb2dec7cfcb43196ffd99789cc4df192da3df. Change-Id: Ib409cd94b9139d44cb4e448b5e515d3efc930bd5 --- M resources/controller/uw.controller.Details.js M resources/mw.UploadWizard.js M resources/mw.UploadWizardUpload.js 3 files changed, 9 insertions(+), 11 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard refs/changes/07/237307/1 diff --git a/resources/controller/uw.controller.Details.js b/resources/controller/uw.controller.Details.js index 4909d54..480dfa8 100644 --- a/resources/controller/uw.controller.Details.js +++ b/resources/controller/uw.controller.Details.js @@ -30,7 +30,7 @@ new uw.ui.Details() .connect( this, { 'start-details': 'startDetails', - 'finalize-details-after-removal': [ 'emit', 'start-details' ] + 'finalize-details-after-removal': [ 'emit', 'finalize-details-after-removal' ] } ), config ); diff --git a/resources/mw.UploadWizard.js b/resources/mw.UploadWizard.js index 565731b..9d0c1b0 100644 --- a/resources/mw.UploadWizard.js +++ b/resources/mw.UploadWizard.js @@ -338,17 +338,18 @@ */ removeUpload: function ( upload ) { // remove the div that passed along the trigger - var $div = $( upload.ui.div ); + var $div = $( upload.ui.div ), + index; $div.unbind(); // everything $div.remove(); // and do what we in the wizard need to do after an upload is removed - this.uploads = $.grep( - this.uploads, - function ( u ) { - return u !== upload; - } - ); + // Remove the upload from the uploads array (modify in-place, as this is shared among various + // things that rely on having current information). + index = this.uploads.indexOf( upload ); + if ( index !== -1 ) { + this.uploads.splice( index, 1 ); + } this.steps.file.updateFileCounts( this.uploads ); diff --git a/resources/mw.UploadWizardUpload.js b/resources/mw.UploadWizardUpload.js index 731cc07..7777f0e 100644 --- a/resources/mw.UploadWizardUpload.js +++ b/resources/mw.UploadWizardUpload.js @@ -134,9 +134,6 @@ if ( this.details && this.details.div ) { this.details.div.remove(); } - if ( this.thanksDiv ) { - this.thanksDiv.remove(); - } // we signal to the wizard to update itself, which has to delete the // final vestige of this upload this.emit( 'remove-upload' ); -- To view, visit https://gerrit.wikimedia.org/r/237307 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib409cd94b9139d44cb4e448b5e515d3efc930bd5 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