X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/8132fc186eb0c5fd02c86828c3a4735754296d02..5913c54d19b8f6775633176032161d49f9b2f1aa:/redakcja/static/js/book_text/jquery.eventdelegation.js diff --git a/redakcja/static/js/book_text/jquery.eventdelegation.js b/redakcja/static/js/book_text/jquery.eventdelegation.js deleted file mode 100644 index 52fce074..00000000 --- a/redakcja/static/js/book_text/jquery.eventdelegation.js +++ /dev/null @@ -1,55 +0,0 @@ -/* - * jQuery Event Delegation Plugin - jquery.eventdelegation.js - * Fast flexible event handling - * - * January 2008 - Randy Morey (http://dev.distilldesign.com/) - */ - -(function ($) { - /* setup list of allowed events for event delegation - * only events that bubble are appropriate - */ - var allowed = {}; - $.each([ - 'click', - 'dblclick', - 'mousedown', - 'mouseup', - 'mousemove', - 'mouseover', - 'mouseout', - 'keydown', - 'keypress', - 'keyup' - ], function(i, eventName) { - allowed[eventName] = true; - }); - - $.fn.extend({ - delegate: function (event, selector, f) { - return $(this).each(function () { - if (allowed[event]) - $(this).bind(event, function (e) { - var el = $(e.target), - result = false; - - while (!$(el).is('body')) { - if ($(el).is(selector)) { - result = f.apply($(el)[0], [e]); - if (result === false) - e.preventDefault(); - return; - } - - el = $(el).parent(); - } - }); - }); - }, - undelegate: function (event) { - return $(this).each(function () { - $(this).unbind(event); - }); - } - }); -})(jQuery); \ No newline at end of file