Browse Source

Add method to re-initialize sortable

Currently it is not possible to re-initialize the sortable component after it's been destroyed. I've added a method and wrapped everything in the attached in there and instead I'm calling that method on attached.
pull/801/head
AndreasGalster 9 years ago
parent
commit
b2d13e0210
  1. 14
      Sortable.html

14
Sortable.html

@ -55,6 +55,17 @@
// <span>hello</span>
// <template is="dom-if">
// <tempalte is="dom-repeat">
this.initialize();
},
detached: function() {
this.sortable.destroy()
},
initialize: function() {
var templates = this.querySelectorAll("template[is='dom-repeat']")
var template = templates[templates.length-1]
@ -108,10 +119,7 @@
this.fire("move", e)
}
}))
},
detached: function() {
this.sortable.destroy()
},
groupChanged : function(value) { this.sortable && this.sortable.option("group", value) },

Loading…
Cancel
Save