dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Correct error handling for exceptions in 'user' module
[lhc/web/wiklou.git]
/
resources
/
src
/
mediawiki
/
mediawiki.checkboxtoggle.js
diff --git
a/resources/src/mediawiki/mediawiki.checkboxtoggle.js
b/resources/src/mediawiki/mediawiki.checkboxtoggle.js
index
62760d2
..
ab7a74e
100644
(file)
--- a/
resources/src/mediawiki/mediawiki.checkboxtoggle.js
+++ b/
resources/src/mediawiki/mediawiki.checkboxtoggle.js
@@
-13,25
+13,27
@@
'use strict';
$( function () {
'use strict';
$( function () {
- var $checkboxes = $( 'li input[type=checkbox]' );
+ // FIXME: This shouldn't be a global selector to avoid conflicts
+ // with unrelated content on the same page. (T131318)
+ var $checkboxes = $( 'li input[type="checkbox"]' );
function selectAll( check ) {
$checkboxes.prop( 'checked', check );
}
$( '.mw-checkbox-all' ).click( function ( e ) {
function selectAll( check ) {
$checkboxes.prop( 'checked', check );
}
$( '.mw-checkbox-all' ).click( function ( e ) {
- selectAll( true );
e.preventDefault();
e.preventDefault();
+ selectAll( true );
} );
$( '.mw-checkbox-none' ).click( function ( e ) {
} );
$( '.mw-checkbox-none' ).click( function ( e ) {
- selectAll( false );
e.preventDefault();
e.preventDefault();
+ selectAll( false );
} );
$( '.mw-checkbox-invert' ).click( function ( e ) {
} );
$( '.mw-checkbox-invert' ).click( function ( e ) {
- $checkboxes.each( function () {
- $( this ).prop( 'checked', !$( this ).is( ':checked' ) );
- } );
e.preventDefault();
e.preventDefault();
+ $checkboxes.prop( 'checked', function ( i, val ) {
+ return !val;
+ } );
} );
} );
} );
} );