Permalink
Browse files

Sortable: prevent inline javascript contained in <script> tags to be …

…executed on First item drop. Fixed #6951 - Inline script executing on FIRST drop.
  • Loading branch information...
1 parent eee63a2 commit f69065782ed1541b389b1e2a090cde211e4c0600 @fadomire committed Jan 13, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 ui/jquery.ui.sortable.js
View
@@ -983,7 +983,11 @@ $.widget("ui.sortable", $.ui.mouse, {
// We first have to update the dom position of the actual currentItem
// Note: don't do it if the current item is already removed (by a user), or it gets reappended (see #4088)
- if(!this._noFinalSort && this.currentItem.parent().length) this.placeholder.before(this.currentItem);
+ if(!this._noFinalSort && this.currentItem.parent().length)
+
+ // We use javascript instead of jquery to insert item, because jquery before() first execute the script and then remove the <script> tag, and for sorting we dont need the js to be evaluated (see #6951)
+ this.currentItem.insertBefore(this.placeholder, this.currentItem);
+
this._noFinalSort = null;
if(this.helper[0] == this.currentItem[0]) {

0 comments on commit f690657

Please sign in to comment.