Browse Source

Merge pull request #801 from AndreasGalster/master

[Polymer component]Added method to re-initialize sortable
pull/779/merge
Lebedev Konstantin 9 years ago
parent
commit
f8a5ddb354
  1. 19
      Sortable.html

19
Sortable.html

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

Loading…
Cancel
Save