jenkins-bot has submitted this change and it was merged. Change subject: jquery.makeCollapsible: Use promise().done instead of when().then ......................................................................
jquery.makeCollapsible: Use promise().done instead of when().then Follows up b340bd4f6b. They both work, but in this case there is no need to use $.when since there is only 1 promise. And there is no need for the filtering proxy of Promise#then either, a straight done is enough. $.when( $foo ).then( callback ) $.when( $foo ).done( callback ) $foo.promise().done( callback ) Change-Id: I4df755a32c124481ca690078191a735d2e2b511a --- M resources/jquery/jquery.makeCollapsible.js 1 file changed, 10 insertions(+), 10 deletions(-) Approvals: Bartosz Dziewoński: Looks good to me, approved jenkins-bot: Verified diff --git a/resources/jquery/jquery.makeCollapsible.js b/resources/jquery/jquery.makeCollapsible.js index 27c4c6c..0cd6417 100644 --- a/resources/jquery/jquery.makeCollapsible.js +++ b/resources/jquery/jquery.makeCollapsible.js @@ -75,10 +75,10 @@ $containers.hide(); hookCallback(); } else { - $.when( $containers.stop( true, true ).fadeOut() ).then( hookCallback ); + $containers.stop( true, true ).fadeOut().promise().done( hookCallback ); } } else { - $.when( $containers.stop( true, true ).fadeIn() ).then( hookCallback ); + $containers.stop( true, true ).fadeIn().promise().done( hookCallback ); } } else if ( !options.plainMode && ( $collapsible.is( 'ul' ) || $collapsible.is( 'ol' ) ) ) { @@ -94,10 +94,10 @@ $containers.hide(); hookCallback(); } else { - $.when( $containers.stop( true, true ).slideUp() ).then( hookCallback ); + $containers.stop( true, true ).slideUp().promise().done( hookCallback ); } } else { - $.when( $containers.stop( true, true ).slideDown() ).then( hookCallback ); + $containers.stop( true, true ).slideDown().promise().done( hookCallback ); } } else { @@ -111,10 +111,10 @@ $collapsibleContent.hide(); hookCallback(); } else { - $.when( $collapsibleContent.slideUp() ).then( hookCallback ); + $collapsibleContent.slideUp().promise().done( hookCallback ); } } else { - $.when( $collapsibleContent.slideDown() ).then( hookCallback ); + $collapsibleContent.slideDown().promise().done( hookCallback ); } // Otherwise assume this is a customcollapse with a remote toggle @@ -126,16 +126,16 @@ hookCallback(); } else { if ( $collapsible.is( 'tr' ) || $collapsible.is( 'td' ) || $collapsible.is( 'th' ) ) { - $.when( $collapsible.fadeOut() ).then( hookCallback ); + $collapsible.fadeOut().promise().done( hookCallback ); } else { - $.when( $collapsible.slideUp() ).then( hookCallback ); + $collapsible.slideUp().promise().done( hookCallback ); } } } else { if ( $collapsible.is( 'tr' ) || $collapsible.is( 'td' ) || $collapsible.is( 'th' ) ) { - $.when( $collapsible.fadeIn() ).then( hookCallback ); + $collapsible.fadeIn().promise().done( hookCallback ); } else { - $.when( $collapsible.slideDown() ).then( hookCallback ); + $collapsible.slideDown().promise().done( hookCallback ); } } } -- To view, visit https://gerrit.wikimedia.org/r/84723 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4df755a32c124481ca690078191a735d2e2b511a Gerrit-PatchSet: 3 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Krinkle <krinklem...@gmail.com> Gerrit-Reviewer: Bartosz Dziewoński <matma....@gmail.com> Gerrit-Reviewer: Jack Phoenix <j...@countervandalism.net> Gerrit-Reviewer: MarkTraceur <mtrac...@member.fsf.org> Gerrit-Reviewer: jenkins-bot _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits