Merge "(bug 39753) UI restores #toc as inline-block instead of table."

This commit is contained in:
Trevor Parscal 2012-09-07 22:01:44 +00:00 committed by Gerrit Code Review
commit 4659557fef
2 changed files with 14 additions and 11 deletions

View file

@ -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 */

View file

@ -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( '<div>' )
.parent()
.data( 've.hideTableOfContents', true )
.slideUp();
};
/**