Bug Tracker

Modify

Ticket #2415 (closed bug: fixed)

Opened 5 years ago

Last modified 5 years ago

draggable destroy() error

Reported by: lideln Owned by: paul
Priority: major Milestone: 1.2.4
Component: ui Version: 1.2.3
Keywords: draggable Cc:
Blocking: Blocked by:

Description

When calling $('.myClass').draggable('destroy'); it crashes javascript on two cases :

  • draggable() has not been called before to add drag capabilities to this object (I think it should just return quietly, not throw a JS error)
  • draggable() has been called without specifying "handle". Adding "if (this.handle)" in the destroy() function fixes the bug.

Change History

comment:1 Changed 5 years ago by paul

  • Status changed from new to closed
  • Resolution set to fixed

this.handle always is available if the draggable is initialized, even if you didn't pass the option - however, I added a check so it doesn't break on non-draggables. Thanks!

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.