Skip to content

Commit 576daf5

Browse files
committed
Fixed bu on target param of isAllowed callback.
1 parent 0eeb760 commit 576daf5

File tree

4 files changed

+24
-21
lines changed

4 files changed

+24
-21
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
<h1><a href="http://camohub.github.io/jquery-sortable-lists/index.html">jquery-sortable-lists</a></h1>
22
<h2 style="font-size:17px">Changelog</h2>
33

4+
<h3>v1.1.1</h3>
5+
<p>Fixed bug on target parameter of isAllowed callback.</p>
6+
47
<h3>v1.1.0</h3>
58
<p>Callback onChange has been implemented.</p>
69

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"dependencies": {
55
"jquery": ">=1 <3.0.0"
66
},
7-
"version": "1.1.0",
7+
"version": "1.1.1",
88
"homepage": "[email protected]:camohub/jquery-sortable-lists.git",
99
"authors": [
1010
"Vladimír Čamaj"

jquery-sortable-lists.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
insertZone: 50,
6060
scroll: 20,
6161
ignoreClass: '',
62-
isAllowed: function( cEl, hint ) { return true; }, // Params: current el., hint el.
62+
isAllowed: function( cEl, hint, target ) { return true; }, // Params: current el., hint el.
6363
onDragStart: function( e, cEl ) { return true; }, // Params: e jQ. event obj., current el.
6464
onChange: function( cEl ) { return true; }, // Params: current el.
6565
complete: function( cEl ) { return true; } // Params: current el.
@@ -606,7 +606,7 @@
606606

607607
hint.css( 'display', 'block' );
608608
// Ensures posible formating of elements. Second call is in the endDrag method.
609-
state.isAllowed = setting.isAllowed( state.cEl.el, $( '#sortableListsHint' ), oEl );
609+
state.isAllowed = setting.isAllowed( state.cEl.el, hint, hint.parents('li').first() );
610610

611611
}
612612

@@ -666,7 +666,7 @@
666666

667667
hint.css( 'display', 'block' );
668668
// Ensures posible formating of elements. Second call is in the endDrag method.
669-
state.isAllowed = setting.isAllowed( state.cEl.el, $( '#sortableListsHint' ), oEl );
669+
state.isAllowed = setting.isAllowed( state.cEl.el, hint, hint.parents('li').first() );
670670

671671
}
672672

jquery-sortable-lists.min.js

Lines changed: 17 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)