From 2a5be28bc5a0fe4748279bebe23d1be6416fe015 Mon Sep 17 00:00:00 2001 From: patdenice Date: Fri, 28 Oct 2011 13:25:54 +0000 Subject: feature:2487 Update jQuery to 1.6.4 and jQuery UI to 1.8.16 git-svn-id: http://piwigo.org/svn/trunk@12525 68402e56-0260-453c-a942-63ccdbb3a9ee --- themes/default/js/ui/jquery.ui.mouse.js | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'themes/default/js/ui/jquery.ui.mouse.js') 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; }, -- cgit v1.2.3