Opened 14 years ago

Closed 14 years ago

Last modified 11 years ago

#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:


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 PERECil

I've successfully reproduced the bug with thoses conditions:

  • final release of Jquery 1.3
  • 1.6RC4 of Jquery UI

The bug could be reproduced with the start, stop and drag methods.

comment:2 Changed 14 years ago by moiseev

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 '$, n, [e, this.uiHash()]);' seems to work fine for me.

comment:3 in reply to:  2 Changed 14 years ago by moiseev

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 paul

Resolution: fixed
Status: newclosed

comment:5 Changed 11 years ago by Scott González

Milestone: 1.later1.7
Note: See TracTickets for help on using tickets.