aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Bakaus <paul.bakaus@googlemail.com>2008-11-03 12:44:50 +0000
committerPaul Bakaus <paul.bakaus@googlemail.com>2008-11-03 12:44:50 +0000
commit9be9c9f699611f18a229efca381ec223a8bd14ec (patch)
tree74dcfc0c8fabd34bd2709acfbdaabb5670ce2ae9
parent77d2c66690b7b622779e289d052fa73b4d56e7fc (diff)
downloadjquery-ui-9be9c9f699611f18a229efca381ec223a8bd14ec.tar.gz
jquery-ui-9be9c9f699611f18a229efca381ec223a8bd14ec.zip
mouse: events and default actions on click are not fired after a drag action has been initiated
-rw-r--r--tests/draggable.js6
-rw-r--r--ui/ui.core.js14
2 files changed, 17 insertions, 3 deletions
diff --git a/tests/draggable.js b/tests/draggable.js
index 74089e72f..c029df6b0 100644
--- a/tests/draggable.js
+++ b/tests/draggable.js
@@ -628,6 +628,12 @@ test("{ helper: 'clone' }, absolute with scroll offset on root and parent", func
});
+module("draggable: behaviour");
+
+test("Events should not be executed on the element if drag is initiated", function() {
+ //TODO: Implement missing test
+});
+
module("draggable: Tickets");
diff --git a/ui/ui.core.js b/ui/ui.core.js
index 877b0d023..1940385d1 100644
--- a/ui/ui.core.js
+++ b/ui/ui.core.js
@@ -345,9 +345,16 @@ $.ui.mouse = {
_mouseInit: function() {
var self = this;
- this.element.bind('mousedown.'+this.widgetName, function(e) {
- return self._mouseDown(e);
- });
+ this.element
+ .bind('mousedown.'+this.widgetName, function(e) {
+ return self._mouseDown(e);
+ })
+ .bind('click.'+this.widgetName, function(e) {
+ if(self._preventClickEvent) {
+ self._preventClickEvent = false;
+ return false;
+ }
+ });
// Prevent text selection in IE
if ($.browser.msie) {
@@ -437,6 +444,7 @@ $.ui.mouse = {
if (this._mouseStarted) {
this._mouseStarted = false;
+ this._preventClickEvent = true;
this._mouseStop(e);
}