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.
This commit is contained in:
parent
c37da68754
commit
66e64cb2f0
3 changed files with 9 additions and 8 deletions
|
|
@ -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.
|
||||
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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 );
|
||||
|
|
|
|||
Loading…
Reference in a new issue