From: TheDJ Date: Sun, 25 Aug 2013 13:03:14 +0000 (+0000) Subject: Merge "Enhanced RC: Optimization of the initial collapsing" X-Git-Tag: 1.31.0-rc.0~18883 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22articles%22%2C%22id_article=%24id_article%22%29%20.%20%22?a=commitdiff_plain;h=e2996404f5b133f6f099b483fc99e9b27b24eae7;hp=2b8b4884ec508d425b5556ca7d1842cb41ab3490;p=lhc%2Fweb%2Fwiklou.git Merge "Enhanced RC: Optimization of the initial collapsing" --- diff --git a/resources/jquery/jquery.makeCollapsible.js b/resources/jquery/jquery.makeCollapsible.js index 597aea117a..f5c204cdea 100644 --- a/resources/jquery/jquery.makeCollapsible.js +++ b/resources/jquery/jquery.makeCollapsible.js @@ -172,7 +172,12 @@ } } - wasCollapsed = $collapsible.hasClass( 'mw-collapsed' ); + // This allows the element to be hidden on initial toggle without fiddling with the class + if ( options.wasCollapsed !== undefined ) { + wasCollapsed = options.wasCollapsed; + } else { + wasCollapsed = $collapsible.hasClass( 'mw-collapsed' ); + } // Toggle the state of the collapsible element (that is, expand or collapse) $collapsible.toggleClass( 'mw-collapsed', !wasCollapsed ); @@ -367,11 +372,9 @@ // Initial state if ( options.collapsed || $collapsible.hasClass( 'mw-collapsed' ) ) { - // Remove here so that the toggler goes in the right direction (the class is re-added) - $collapsible.removeClass( 'mw-collapsed' ); // One toggler can hook to multiple elements, and one element can have // multiple togglers. This is the sanest way to handle that. - actionHandler.call( $toggleLink.get( 0 ), null, { instantHide: true } ); + actionHandler.call( $toggleLink.get( 0 ), null, { instantHide: true, wasCollapsed: false } ); } } ); }; diff --git a/resources/mediawiki.special/mediawiki.special.changeslist.enhanced.css b/resources/mediawiki.special/mediawiki.special.changeslist.enhanced.css index 2632c787af..bed580d715 100644 --- a/resources/mediawiki.special/mediawiki.special.changeslist.enhanced.css +++ b/resources/mediawiki.special/mediawiki.special.changeslist.enhanced.css @@ -37,6 +37,17 @@ table.mw-enhanced-rc td.mw-enhanced-rc-nested { display: none; } +/* + * And if it's enabled, let's optimize the collapsing a little: hide the rows + * that would be hidden by jquery.makeCollapsible with CSS to save us some + * reflows and repaints. This doesn't work on browsers that don't fully support + * CSS2 (IE6), but it's okay, this will be done in JavaScript with old degraded + * performance instead. + */ +.client-js table.mw-enhanced-rc.mw-collapsed tr + tr { + display: none; +} + .mw-enhancedchanges-arrow-space { display: inline-block; *display: inline; /* IE7 and below */