r101262 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r101261‎ | r101262 | r101263 >
Date:13:44, 29 October 2011
Author:liangent
Status:deferred
Tags:
Comment:
Allow custom toggle links to be specified by children with a certain class.
This enable templates using this feature to be used multiple times.
Modified paths:
  • /branches/liangent/makeCollapsible_custom/phase3/resources/jquery/jquery.makeCollapsible.js (modified) (history)

Diff [purge]

Index: branches/liangent/makeCollapsible_custom/phase3/resources/jquery/jquery.makeCollapsible.js
@@ -264,6 +264,26 @@
265265 toggleLinkCustom( $customTogglers, null, $that );
266266 }
267267
 268+ // Custom toggle link specified by children with a certain class
 269+ } else if ( $that.hasClass( 'mw-customcollapsiblechildren' ) ) {
 270+
 271+ var $customTogglers = $( '.mw-customtoggle', $that );
 272+
 273+ // Double check that there is actually a customtoggle link
 274+ if ( $customTogglers.length ) {
 275+ $customTogglers.bind( 'click.mw-collapse', function( e ) {
 276+ toggleLinkCustom( $(this), e, $that );
 277+ } );
 278+ } else {
 279+ mw.log( _fn + '<children> .mw-customtoggle: Missing toggler!' );
 280+ }
 281+
 282+ // Initial state
 283+ if ( $that.hasClass( 'mw-collapsed' ) ) {
 284+ $that.removeClass( 'mw-collapsed' );
 285+ toggleLinkCustom( $customTogglers, null, $that );
 286+ }
 287+
268288 // If this is not a custom case, do the default:
269289 // Wrap the contents add the toggle link
270290 } else {

Follow-up revisions

RevisionCommit summaryAuthorDate
r101263* Followup r101262: Fix the bug that .mw-customcollapsiblechildren does not w...liangent14:39, 29 October 2011

Status & tagging log