Use a monkey patch instead of hacking code

Refs https://github.com/johnny/jquery-sortable/pull/122
This commit is contained in:
Samuel Georges 2015-07-18 14:16:34 +10:00
parent 15c23089c6
commit 37a5782178
2 changed files with 9 additions and 4 deletions

View File

@ -144,6 +144,15 @@
this.dispose()
}
// External solution for group persistence
// See https://github.com/johnny/jquery-sortable/pull/122
Sortable.prototype.destroyGroup = function() {
var jqSortable = this.$el.data('jqSortable')
if (jqSortable.group) {
jqSortable.group._destroy()
}
}
Sortable.DEFAULTS = {
useAnimation: false,
usePlaceholderClone: false,

View File

@ -631,10 +631,6 @@
return val != that
})
// See https://github.com/johnny/jquery-sortable/pull/122
if(this.group)
this.group._destroy()
$.each(this.items || [], function(){
$.removeData(this, subContainerKey)
})