Moving check higher up in case there's a premade toggle _but_ no .wm-collapsible...
authorKrinkle <krinkle@users.mediawiki.org>
Mon, 23 May 2011 19:08:26 +0000 (19:08 +0000)
committerKrinkle <krinkle@users.mediawiki.org>
Mon, 23 May 2011 19:08:26 +0000 (19:08 +0000)
RELEASE-NOTES-1.19
docs/globals.txt
resources/jquery/jquery.makeCollapsible.js

index 6cffc82..1e7bf62 100644 (file)
@@ -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.
 
index ac4bd79..8b4c755 100644 (file)
@@ -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.
index 1f4fbe3..ea6418e 100644 (file)
@@ -294,14 +294,15 @@ $.fn.makeCollapsible = function() {
                                }
        
                        } else { // <div>, <p> 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( '<div class="mw-collapsible-content"></div>' );
                                }
        
-                               // 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 );