Skip to content

Instantly share code, notes, and snippets.

@egrajeda
Created January 4, 2014 19:00
Show Gist options
  • Save egrajeda/8259186 to your computer and use it in GitHub Desktop.
Save egrajeda/8259186 to your computer and use it in GitHub Desktop.
From 79f8b7ed80b4f52cfd398021441428b3dd095e4b Mon Sep 17 00:00:00 2001
From: Eduardo Grajeda <tatofoo@gmail.com>
Date: Sat, 4 Jan 2014 12:56:36 -0600
Subject: [PATCH] Sortable: cancel() now doesn't ignore comment nodes
Fixes #9727
---
ui/jquery.ui.sortable.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ui/jquery.ui.sortable.js b/ui/jquery.ui.sortable.js
index 4ba2576..1a41d71 100644
--- a/ui/jquery.ui.sortable.js
+++ b/ui/jquery.ui.sortable.js
@@ -205,7 +205,7 @@ $.widget("ui.sortable", $.ui.mouse, {
(o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt));
//Cache the former DOM position
- this.domPosition = { prev: this.currentItem.prev()[0], parent: this.currentItem.parent()[0] };
+ this.domPosition = { prev: this.currentItem[0].previousSibling, parent: this.currentItem.parent()[0] };
//If the helper is not the original, hide the original so it's not playing any role during the drag, won't cause anything bad this way
if(this.helper[0] !== this.currentItem[0]) {
--
1.8.1.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment