Skip to content

Commit

Permalink
mouse: events and default actions on click are not fired after a drag…
Browse files Browse the repository at this point in the history
… action has been initiated
  • Loading branch information
Paul Bakaus committed Nov 3, 2008
1 parent 77d2c66 commit 9be9c9f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
6 changes: 6 additions & 0 deletions tests/draggable.js
Expand Up @@ -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"); module("draggable: Tickets");


Expand Down
14 changes: 11 additions & 3 deletions ui/ui.core.js
Expand Up @@ -345,9 +345,16 @@ $.ui.mouse = {
_mouseInit: function() { _mouseInit: function() {
var self = this; var self = this;


this.element.bind('mousedown.'+this.widgetName, function(e) { this.element
return self._mouseDown(e); .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 // Prevent text selection in IE
if ($.browser.msie) { if ($.browser.msie) {
Expand Down Expand Up @@ -437,6 +444,7 @@ $.ui.mouse = {


if (this._mouseStarted) { if (this._mouseStarted) {
this._mouseStarted = false; this._mouseStarted = false;
this._preventClickEvent = true;
this._mouseStop(e); this._mouseStop(e);
} }


Expand Down

0 comments on commit 9be9c9f

Please sign in to comment.