diff options
author | David Bonner <dbonner@cogolabs.com> | 2012-10-15 17:20:33 -0400 |
---|---|---|
committer | Rick Waldron <waldron.rick@gmail.com> | 2012-10-15 17:20:33 -0400 |
commit | 9104a3d5f2a1bb72b89ebdbad3f0bfdb2ea8ab74 (patch) | |
tree | 5f145091dacd9348725f20fe6e6fa9535ad9c3ef /src/event.js | |
parent | d6c84c5bb55814df0063e04b12c4143d07cba3f7 (diff) | |
download | jquery-9104a3d5f2a1bb72b89ebdbad3f0bfdb2ea8ab74.tar.gz jquery-9104a3d5f2a1bb72b89ebdbad3f0bfdb2ea8ab74.zip |
Deprecate fn toggle Closes gh-970 https://github.com/jquery/2012-dev-summit/issues/24
Diffstat (limited to 'src/event.js')
-rw-r--r-- | src/event.js | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/src/event.js b/src/event.js index 153045ac5..91ec7d757 100644 --- a/src/event.js +++ b/src/event.js @@ -980,32 +980,6 @@ jQuery.fn.extend({ } }, - toggle: function( fn ) { - // Save reference to arguments for access in closure - var args = arguments, - guid = fn.guid || jQuery.guid++, - i = 0, - toggler = function( event ) { - // Figure out which function to execute - var lastToggle = ( jQuery._data( this, "lastToggle" + fn.guid ) || 0 ) % i; - jQuery._data( this, "lastToggle" + fn.guid, lastToggle + 1 ); - - // Make sure that clicks stop - event.preventDefault(); - - // and execute the function - return args[ lastToggle ].apply( this, arguments ) || false; - }; - - // link all the functions, so any of them can unbind this click handler - toggler.guid = guid; - while ( i < args.length ) { - args[ i++ ].guid = guid; - } - - return this.click( toggler ); - }, - hover: function( fnOver, fnOut ) { return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); } |