From: Victor Porton Date: Sun, 26 Jun 2016 13:30:54 +0000 (+0300) Subject: jquery.makeCollapsible: Special case of content inside
  • X-Git-Tag: 1.31.0-rc.0~5976^2~1 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=0eb8eeabd42dfa4af59d423d46aa5ac3d4147688;p=lhc%2Fweb%2Fwiklou.git jquery.makeCollapsible: Special case of content inside
  • Bug: T137676 Change-Id: Ie4228e63a63157e3909e938a4086f46dcbbf6767 --- diff --git a/resources/src/jquery/jquery.makeCollapsible.js b/resources/src/jquery/jquery.makeCollapsible.js index bdb5ce8af3..501e898ebd 100644 --- a/resources/src/jquery/jquery.makeCollapsible.js +++ b/resources/src/jquery/jquery.makeCollapsible.js @@ -314,6 +314,7 @@ // If this is not a custom case, do the default: wrap the // contents and add the toggle link. Different elements are // treated differently. + if ( $collapsible.is( 'table' ) ) { // If the table has a caption, collapse to the caption @@ -345,6 +346,12 @@ } } + } else if ( $collapsible.parent().is( 'li' ) && + $collapsible.parent().children( '.mw-collapsible' ).size() === 1 + ) { + // special case of one collapsible in
  • tag + $toggleLink = buildDefaultToggleLink(); + $collapsible.before( $toggleLink ); } else if ( $collapsible.is( 'ul' ) || $collapsible.is( 'ol' ) ) { // The toggle-link will be in the first list-item $firstItem = $collapsible.find( 'li:first' );