jenkins-bot has submitted this change and it was merged. Change subject: mw.ViewPageTarget: Fix broken firstHeading transition ......................................................................
mw.ViewPageTarget: Fix broken firstHeading transition Class ve-init-mw-viewPageTarget-pageTitle added various transition settings that were never used. Meanwhile, we're doing fadeTo which sets inline opacity css every X ms until the animation is finished. * Changed the inline jQuery animation to use css transitions instead. * Removed the inexistent and obsolete ms-transition declaration. * Removed ":visible" from selector query. This makes the selector more performant (since :visible is a proprietary Sizzle keyword) and it was obsolete anyway. The classes don't affect display none/hide, this is handled naturally by the browser now. Change-Id: Ibdfb442ff6c743ef16b514a7696796ee27821887 --- M modules/ve-mw/init/styles/ve.init.mw.ViewPageTarget.css M modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js 2 files changed, 20 insertions(+), 5 deletions(-) Approvals: Esanders: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/ve-mw/init/styles/ve.init.mw.ViewPageTarget.css b/modules/ve-mw/init/styles/ve.init.mw.ViewPageTarget.css index 88e8152..d40c1c5 100644 --- a/modules/ve-mw/init/styles/ve.init.mw.ViewPageTarget.css +++ b/modules/ve-mw/init/styles/ve.init.mw.ViewPageTarget.css @@ -7,12 +7,22 @@ /* VisualEditor */ -.ve-init-mw-viewPageTarget-pageTitle { +.ve-init-mw-viewPageTarget-transform { -webkit-transition: opacity 200ms ease-out; -moz-transition: opacity 200ms ease-out; - -ms-transition: opacity 200ms ease-out; -o-transition: opacity 200ms ease-out; transition: opacity 200ms ease-out; +} + +.ve-init-mw-viewPageTarget-transform-muted { + opacity: 0.6; +} + +.ve-init-mw-viewPageTarget-transform-hidden { + opacity: 0; +} + +.ve-init-mw-viewPageTarget-pageTitle { cursor: default; } diff --git a/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js b/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js index 1ed3dad..866d972 100644 --- a/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js +++ b/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js @@ -1893,8 +1893,10 @@ * @method */ ve.init.mw.ViewPageTarget.prototype.mutePageTitle = function () { - $( '#firstHeading, #siteSub:visible' ).fadeTo( 'fast', 0.6 ); - $( '#contentSub:visible' ).fadeTo( 'fast', 0 ); + $( '#firstHeading, #siteSub' ) + .addClass( 've-init-mw-viewPageTarget-transform ve-init-mw-viewPageTarget-transform-muted' ); + $( '#contentSub' ) + .addClass( 've-init-mw-viewPageTarget-transform ve-init-mw-viewPageTarget-transform-hidden' ); }; /** @@ -1903,8 +1905,11 @@ * @method */ ve.init.mw.ViewPageTarget.prototype.restorePageTitle = function () { - $( '#firstHeading, #siteSub:visible, #contentSub:visible' ).fadeTo( 'fast', 1 ); + var $els = $( '#firstHeading, #siteSub, #contentSub' ) + .removeClass( 've-init-mw-viewPageTarget-transform-muted ve-init-mw-viewPageTarget-transform-hidden' ); + setTimeout( function () { + $els.removeClass( 've-init-mw-viewPageTarget-transform' ); $( '#firstHeading' ).removeClass( 've-init-mw-viewPageTarget-pageTitle' ); }, 1000 ); }; -- To view, visit https://gerrit.wikimedia.org/r/87891 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibdfb442ff6c743ef16b514a7696796ee27821887 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/VisualEditor Gerrit-Branch: master Gerrit-Owner: Krinkle <krinklem...@gmail.com> Gerrit-Reviewer: Catrope <roan.katt...@gmail.com> Gerrit-Reviewer: Esanders <esand...@wikimedia.org> Gerrit-Reviewer: Trevor Parscal <tpars...@wikimedia.org> Gerrit-Reviewer: jenkins-bot _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits