Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix on restoreItemAtIndex function when restoring an element from a list with only one element #109

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add afterRestoreItem callback
marcobarbosa16 committed Oct 24, 2018
commit db44fe00a55fd5f37b0dadac3dd20d81e7d2ad0e
2 changes: 1 addition & 1 deletion dist/jquery.nestable.min.js

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions jquery.nestable.js
Original file line number Diff line number Diff line change
@@ -65,6 +65,7 @@
callback: function(l, e, p) {},
onDragStart: function(l, e, p) {},
beforeDragStop: function(l, e, p) {},
afterRestoreItem: function(l, e, p) {},
listRenderer: function(children, options) {
var html = '<' + options.listNodeName + ' class="' + options.listClass + '">';
html += children;
@@ -815,6 +816,7 @@
}
this.restoreItemAtIndex(el, srcIndex);
this.reset();
this.options.afterRestoreItem.call(this, this.el, el, this.placeEl.parent());
return;
}

@@ -823,6 +825,7 @@
if (this.hasNewRoot) {
if (this.options.fixed === true) {
this.restoreItemAtIndex(el, srcIndex);
this.options.afterRestoreItem.call(this, this.el, el, this.placeEl.parent());
}
else {
this.el.trigger('lostItem');
3,112 changes: 2,011 additions & 1,101 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -47,8 +47,8 @@
"gulp-clean-css": "^3.4.2",
"gulp-eslint": "^4.0.0",
"gulp-rename": "^1.2.2",
"gulp-uglify": "^3.0.0",
"gulp-sass": "^3.1.0"
"gulp-sass": "^3.1.0",
"gulp-uglify": "^3.0.0"
},
"license": "MIT",
"bugs": {