diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2013-01-18 16:46:04 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2013-01-18 16:46:04 +0100 |
commit | 63601400e476c6cf43d985f3e7b9864681695ed4 (patch) | |
tree | f7846203a952e38aaf66989d0a4702779f549962 /resources/jquery/jquery.checkboxShiftClick.js | |
parent | 8ff01378c9e0207f9169b81966a51def645b6a51 (diff) |
Update to MediaWiki 1.20.2
this update includes:
* adjusted Arch Linux skin
* updated FluxBBAuthPlugin
* patch for https://bugzilla.wikimedia.org/show_bug.cgi?id=44024
Diffstat (limited to 'resources/jquery/jquery.checkboxShiftClick.js')
-rw-r--r-- | resources/jquery/jquery.checkboxShiftClick.js | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/resources/jquery/jquery.checkboxShiftClick.js b/resources/jquery/jquery.checkboxShiftClick.js index 0a1d7d7d..1990dc0d 100644 --- a/resources/jquery/jquery.checkboxShiftClick.js +++ b/resources/jquery/jquery.checkboxShiftClick.js @@ -6,23 +6,22 @@ * @author Krinkle <krinklemail@gmail.com> * @license GPL v2 */ -( function( $ ) { -$.fn.checkboxShiftClick = function( text ) { - var prevCheckbox = null; - var $box = this; - // When our boxes are clicked.. - $box.click( function( e ) { - // And one has been clicked before... - if ( prevCheckbox !== null && e.shiftKey ) { - // Check or uncheck this one and all in-between checkboxes - $box.slice( - Math.min( $box.index( prevCheckbox ), $box.index( e.target ) ), - Math.max( $box.index( prevCheckbox ), $box.index( e.target ) ) + 1 - ).prop( 'checked', e.target.checked ? true : false ); - } - // Either way, update the prevCheckbox variable to the one clicked now - prevCheckbox = e.target; - } ); - return $box; -}; -} )( jQuery );
\ No newline at end of file +( function ( $ ) { + $.fn.checkboxShiftClick = function ( text ) { + var prevCheckbox = null, $box = this; + // When our boxes are clicked.. + $box.click( function ( e ) { + // And one has been clicked before... + if ( prevCheckbox !== null && e.shiftKey ) { + // Check or uncheck this one and all in-between checkboxes + $box.slice( + Math.min( $box.index( prevCheckbox ), $box.index( e.target ) ), + Math.max( $box.index( prevCheckbox ), $box.index( e.target ) ) + 1 + ).prop( 'checked', !!e.target.checked ); + } + // Either way, update the prevCheckbox variable to the one clicked now + prevCheckbox = e.target; + } ); + return $box; + }; +}( jQuery ) ); |