From 66e64cb2f000e1f1f7c0e51f92a47aa81d882024 Mon Sep 17 00:00:00 2001 From: Krinkle Date: Mon, 23 May 2011 19:08:26 +0000 Subject: [PATCH] Moving check higher up in case there's a premade toggle _but_ no .wm-collapsible-content premade. This way the link will be caught before it's inner-wrapped, after which it would no longer be a direct child. --- RELEASE-NOTES-1.19 | 2 +- docs/globals.txt | 8 ++++---- resources/jquery/jquery.makeCollapsible.js | 7 ++++--- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/RELEASE-NOTES-1.19 b/RELEASE-NOTES-1.19 index 6cffc82a16..1e7bf62e67 100644 --- a/RELEASE-NOTES-1.19 +++ b/RELEASE-NOTES-1.19 @@ -100,7 +100,7 @@ changes to languages because of Bugzilla reports. * Bhojpuri (bho) (renamed from "bh"). * (bug 29031) When translating block log entries, indefinite, infinite, and infinity are now considered the same. - + === Other changes in 1.19 === * Removed legacy wgAjaxWatch javascript global object, no longer in use. diff --git a/docs/globals.txt b/docs/globals.txt index ac4bd792ce..8b4c755bfe 100644 --- a/docs/globals.txt +++ b/docs/globals.txt @@ -9,7 +9,7 @@ in a much more flexible way. Consider the elegance of: # Generate the article HTML as if viewed by a web request $article = new Article( Title::newFromText( $t ) ); $article->view(); - + versus # Save current globals @@ -29,13 +29,13 @@ Some of the current MediaWiki developers have an idle fantasy that some day, globals will be eliminated from MediaWiki entirely, replaced by an application object which would be passed to constructors. Whether that would be an efficient, convenient solution remains to be seen, but certainly PHP 5 makes -such object-oriented programming models easier than they were in previous +such object-oriented programming models easier than they were in previous versions. For the time being though, MediaWiki programmers will have to work in an environment with some global context. At the time of writing, 418 globals were -initialised on startup by MediaWiki. 304 of these were configuration settings, -which are documented in DefaultSettings.php. There is no comprehensive +initialised on startup by MediaWiki. 304 of these were configuration settings, +which are documented in DefaultSettings.php. There is no comprehensive documentation for the remaining 114 globals, however some of the most important ones are listed below. They are typically initialised either in index.php or in Setup.php. diff --git a/resources/jquery/jquery.makeCollapsible.js b/resources/jquery/jquery.makeCollapsible.js index 1f4fbe3454..ea6418ecbc 100644 --- a/resources/jquery/jquery.makeCollapsible.js +++ b/resources/jquery/jquery.makeCollapsible.js @@ -294,14 +294,15 @@ $.fn.makeCollapsible = function() { } } else { //
,

etc. + + // The toggle-link will be the first child of the element + var $toggle = $that.find( '> .mw-collapsible-toggle' ); + // If a direct child .content-wrapper does not exists, create it if ( !$that.find( '> .mw-collapsible-content' ).length ) { $that.wrapInner( '

' ); } - // The toggle-link will be the first child of the element - var $toggle = $that.find( '> .mw-collapsible-toggle' ); - // If theres no toggle link, add it if ( !$toggle.length ) { $that.prepend( $toggleLink ); -- 2.20.1