Opened 9 years ago

Closed 7 years ago

#6951 closed bug (wontfix)

Inline script executing on FIRST drop.

Reported by: santhoshs Owned by:
Priority: minor Milestone: 2.0.0
Component: ui.sortable Version: 1.8.7
Keywords: Cc:
Blocked by: Blocking:

Description

I have a test page with simple drag and drop between two list. The issue is when I try to drag and drop "item 4" the inline script given inside LI will execute on FIRST drop. If I drag and drop for the SECOND time the inline Javascript will not execute.

Here is a sample test page http://jsfiddle.net/39ZvN/16/

On page load you can see a alert message. After that try to drag "item 4" for the first time you will see a alert message. If you try it again you will not see the alert.

Issue is Inline javascript is executing only on first drag.

Please provide solution ASAP.

Using Jquery 1.4.4 and UI Sortable 1.8.7

Change History (3)

comment:1 Changed 8 years ago by Flint Makal

I sent a pull request to fix this.

https://github.com/jquery/jquery-ui/pull/572

Problem is that $.before() function that is used to append the sorted element, trigger an eval of the script (execute it) and then remove the <script> tag. I changed this to pure javascript insertBefore() to avoid the javascript to be executed.

Last edited 8 years ago by Flint Makal (previous) (diff)

comment:2 Changed 7 years ago by Scott González

Milestone: 1.9.02.0.0

comment:3 Changed 7 years ago by mikesherov

Resolution: wontfix
Status: newclosed

Thanks for contributing! This issue is going to be resolved in jQuery core in 1.9 here: http://bugs.jquery.com/ticket/11795 for that reason, I'm resolving this as wontfix as we won't be fixing this in jQuery UI.

Note: See TracTickets for help on using tickets.