#3802 closed bug (fixed)
Draggable: Drag callback not called when using Jquery 1.3b2
Reported by: | yo-han | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | 1.7 |
Component: | ui.draggable | Version: | 1.5.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
When I use Jquery-UI with the Jquery 1.3b2 the drag callback is not called. In the code below the alert "hello world" never shows up.
$j('#dragger').draggable({cursor:'move',containment:'#div',appendTo:'#div',drag:function(e,ui){ alert('hello world'); }})
Change History (5)
comment:1 Changed 14 years ago by
comment:2 follow-up: 3 Changed 14 years ago by
Adding the following code to the ui.draggable.js:
if(this.options[n]) { this.options[n].apply(this.element, [e, this.uiHash()]); }
inside propagate method right after '$.ui.plugin.call(this, n, [e, this.uiHash()]);' seems to work fine for me.
comment:3 Changed 14 years ago by
As far as I understood digging deep into the code - the problem is that the call to 'this.element.triggerHandler' does not use 'this.options[n]' being passed in a last argument as an event handler but only as an event name (see jQuery.triggerHandler and jQuery.trigger). Correct me if I'm wrong. I was also able to get it to work updating the 'init' method in ui.draggable.js appending the following lines to it:
if(o['start']) this.element.bind('dragstart.'+this.widgetName, o['start']); if(o['stop']) this.element.bind('dragstop.'+this.widgetName, o['stop']); if(o['drag']) this.element.bind('drag.'+this.widgetName, o['drag']);
BUT! In this case it works significantly slower. PS: The same problem with ui.resizable.js.
comment:4 Changed 14 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:5 Changed 11 years ago by
Milestone: | 1.later → 1.7 |
---|
I've successfully reproduced the bug with thoses conditions:
The bug could be reproduced with the start, stop and drag methods.