diff options
Diffstat (limited to 'javascript/jquery/plugins/jquery-tooltip/lib/jquery.delegate.js')
| -rw-r--r-- | javascript/jquery/plugins/jquery-tooltip/lib/jquery.delegate.js | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/javascript/jquery/plugins/jquery-tooltip/lib/jquery.delegate.js b/javascript/jquery/plugins/jquery-tooltip/lib/jquery.delegate.js deleted file mode 100644 index 09f197d..0000000 --- a/javascript/jquery/plugins/jquery-tooltip/lib/jquery.delegate.js +++ /dev/null @@ -1,56 +0,0 @@ -/* - * jQuery delegate plug-in v1.0 - * - * Copyright (c) 2007 Jörn Zaefferer - * - * $Id: jquery.delegate.js,v 1.1 2009/11/09 19:06:02 tylerbello Exp $ - * - * Dual licensed under the MIT and GPL licenses: - * http://www.opensource.org/licenses/mit-license.php - * http://www.gnu.org/licenses/gpl.html - */ - -// provides cross-browser focusin and focusout events -// IE has native support, in other browsers, use event caputuring (neither bubbles) - -// provides delegate(type: String, delegate: Selector, handler: Callback) plugin for easier event delegation -// handler is only called when $(event.target).is(delegate), in the scope of the jQuery-object for event.target - -// provides triggerEvent(type: String, target: Element) to trigger delegated events -;(function($) { - $.each({ - focus: 'focusin', - blur: 'focusout' - }, function( original, fix ){ - $.event.special[fix] = { - setup:function() { - if ( $.browser.msie ) return false; - this.addEventListener( original, $.event.special[fix].handler, true ); - }, - teardown:function() { - if ( $.browser.msie ) return false; - this.removeEventListener( original, - $.event.special[fix].handler, true ); - }, - handler: function(e) { - arguments[0] = $.event.fix(e); - arguments[0].type = fix; - return $.event.handle.apply(this, arguments); - } - }; - }); - - $.extend($.fn, { - delegate: function(type, delegate, handler) { - return this.bind(type, function(event) { - var target = $(event.target); - if (target.is(delegate)) { - return handler.apply(target, arguments); - } - }); - }, - triggerEvent: function(type, target) { - return this.triggerHandler(type, [jQuery.event.fix({ type: type, target: target })]); - } - }) -})(jQuery); |
