diff --git a/modules/ve/init/mw/styles/ve.init.mw.ViewPageTarget.css b/modules/ve/init/mw/styles/ve.init.mw.ViewPageTarget.css index f90ee5f5de..83791706b0 100644 --- a/modules/ve/init/mw/styles/ve.init.mw.ViewPageTarget.css +++ b/modules/ve/init/mw/styles/ve.init.mw.ViewPageTarget.css @@ -19,11 +19,6 @@ cursor: default; } -.ve-init-mw-viewPageTarget-pageToc { - display: inline-block; - overflow: hidden; -} - .ve-init-mw-viewPageTarget-loadingSpinner, .ve-init-mw-viewPageTarget-saveDialog-saving { /* @embed */ diff --git a/modules/ve/init/mw/targets/ve.init.mw.ViewPageTarget.js b/modules/ve/init/mw/targets/ve.init.mw.ViewPageTarget.js index 50ac7beb8b..1bd8c90778 100644 --- a/modules/ve/init/mw/targets/ve.init.mw.ViewPageTarget.js +++ b/modules/ve/init/mw/targets/ve.init.mw.ViewPageTarget.js @@ -771,7 +771,7 @@ ve.init.mw.ViewPageTarget.prototype.showPageContent = function () { * @method */ ve.init.mw.ViewPageTarget.prototype.mutePageContent = function () { - $( '#bodyContent > :visible:not(#siteSub,#contentSub)' ) + $( '#bodyContent > :visible:not(#siteSub, #contentSub)' ) .addClass( 've-init-mw-viewPageTarget-content' ) .fadeTo( 'fast', 0.6 ); }; @@ -782,7 +782,7 @@ ve.init.mw.ViewPageTarget.prototype.mutePageContent = function () { * @method */ ve.init.mw.ViewPageTarget.prototype.hidePageContent = function () { - $( '#bodyContent > :visible:not(#siteSub,#contentSub)' ) + $( '#bodyContent > :visible:not(#siteSub, #contentSub)' ) .addClass( 've-init-mw-viewPageTarget-content' ) .hide(); }; @@ -793,9 +793,13 @@ ve.init.mw.ViewPageTarget.prototype.hidePageContent = function () { * @method */ ve.init.mw.ViewPageTarget.prototype.showTableOfContents = function () { - $( '#toc' ).slideDown( 'fast', function () { - $(this).removeClass( 've-init-mw-viewPageTarget-pageToc' ); - } ); + var $toc = $( '#toc' ), + $wrap = $toc.parent(); + if ( $wrap.data( 've.hideTableOfContents' ) ) { + $wrap.slideDown(function () { + $toc.unwrap(); + }); + } }; /** @@ -804,7 +808,11 @@ ve.init.mw.ViewPageTarget.prototype.showTableOfContents = function () { * @method */ ve.init.mw.ViewPageTarget.prototype.hideTableOfContents = function () { - $( '#toc' ).addClass( 've-init-mw-viewPageTarget-pageToc' ).slideUp( 'fast' ); + $( '#toc' ) + .wrap( '
' ) + .parent() + .data( 've.hideTableOfContents', true ) + .slideUp(); }; /**