Skip to content

Commit 040fa49

Browse files
committed
In Opera dragend isn't triggred after drop event, so we trigger it manually. Closes #16.
1 parent 1af1425 commit 040fa49

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

jquery.sortable.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,13 @@ $.fn.sortable = function(options) {
4343
dt.setData('Text', 'dummy');
4444
index = (dragging = $(this)).addClass('sortable-dragging').index();
4545
}).on('dragend.h5s', function() {
46+
if (!dragging) {
47+
return;
48+
}
4649
dragging.removeClass('sortable-dragging').show();
4750
placeholders.detach();
4851
if (index != dragging.index()) {
49-
items.parent().trigger('sortupdate', {item: dragging});
52+
dragging.parent().trigger('sortupdate', {item: dragging});
5053
}
5154
dragging = null;
5255
}).not('a[href], img').on('selectstart.h5s', function() {
@@ -59,6 +62,7 @@ $.fn.sortable = function(options) {
5962
if (e.type == 'drop') {
6063
e.stopPropagation();
6164
placeholders.filter(':visible').after(dragging);
65+
dragging.trigger('dragend.h5s');
6266
return false;
6367
}
6468
e.preventDefault();

0 commit comments

Comments
 (0)