diff options
Diffstat (limited to '')
-rw-r--r-- | themes/default/js/ui/jquery.ui.mouse.js | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/themes/default/js/ui/jquery.ui.mouse.js b/themes/default/js/ui/jquery.ui.mouse.js index 3c3e7970a..62fcd2b20 100644 --- a/themes/default/js/ui/jquery.ui.mouse.js +++ b/themes/default/js/ui/jquery.ui.mouse.js @@ -1,5 +1,5 @@ /*! - * jQuery UI Mouse 1.8.10 + * jQuery UI Mouse 1.8.16 * * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. @@ -12,6 +12,11 @@ */ (function( $, undefined ) { +var mouseHandled = false; +$( document ).mouseup( function( e ) { + mouseHandled = false; +}); + $.widget("ui.mouse", { options: { cancel: ':input,option', @@ -44,9 +49,7 @@ $.widget("ui.mouse", { _mouseDown: function(event) { // don't let more than one widget handle mouseStart - // TODO: figure out why we have to use originalEvent - event.originalEvent = event.originalEvent || {}; - if (event.originalEvent.mouseHandled) { return; } + if( mouseHandled ) { return }; // we may have missed mouseup (out of window) (this._mouseStarted && this._mouseUp(event)); @@ -55,7 +58,9 @@ $.widget("ui.mouse", { var self = this, btnIsLeft = (event.which == 1), - elIsCancel = (typeof this.options.cancel == "string" ? $(event.target).parents().add(event.target).filter(this.options.cancel).length : false); + // event.target.nodeName works around a bug in IE 8 with + // disabled inputs (#7620) + elIsCancel = (typeof this.options.cancel == "string" && event.target.nodeName ? $(event.target).closest(this.options.cancel).length : false); if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) { return true; } @@ -75,6 +80,11 @@ $.widget("ui.mouse", { } } + // Click event may never have fired (Gecko & Opera) + if (true === $.data(event.target, this.widgetName + '.preventClickEvent')) { + $.removeData(event.target, this.widgetName + '.preventClickEvent'); + } + // these delegates are required to keep context this._mouseMoveDelegate = function(event) { return self._mouseMove(event); @@ -87,7 +97,8 @@ $.widget("ui.mouse", { .bind('mouseup.'+this.widgetName, this._mouseUpDelegate); event.preventDefault(); - event.originalEvent.mouseHandled = true; + + mouseHandled = true; return true; }, |