Add any prior block to BlockIpComplete hook
[lhc/web/wiklou.git] / resources / src / mediawiki / mediawiki.checkboxtoggle.js
index a2386b3..62760d2 100644 (file)
 ( function ( mw, $ ) {
        'use strict';
 
-       var $checkboxes = $( 'li input[type=checkbox]' );
+       $( function () {
+               var $checkboxes = $( 'li input[type=checkbox]' );
 
-       function selectAll( check ) {
-               $checkboxes.prop( 'checked', check );
-       }
+               function selectAll( check ) {
+                       $checkboxes.prop( 'checked', check );
+               }
 
-       $( '.mw-checkbox-all' ).click( function ( e ) {
-               selectAll( true );
-               e.preventDefault();
-       } );
-       $( '.mw-checkbox-none' ).click( function ( e ) {
-               selectAll( false );
-               e.preventDefault();
-       } );
-       $( '.mw-checkbox-invert' ).click( function ( e ) {
-               $checkboxes.each( function () {
-                       $( this ).prop( 'checked', !$( this ).is( ':checked' ) );
+               $( '.mw-checkbox-all' ).click( function ( e ) {
+                       selectAll( true );
+                       e.preventDefault();
+               } );
+               $( '.mw-checkbox-none' ).click( function ( e ) {
+                       selectAll( false );
+                       e.preventDefault();
                } );
-               e.preventDefault();
+               $( '.mw-checkbox-invert' ).click( function ( e ) {
+                       $checkboxes.each( function () {
+                               $( this ).prop( 'checked', !$( this ).is( ':checked' ) );
+                       } );
+                       e.preventDefault();
+               } );
+
        } );
 
 }( mediaWiki, jQuery ) );