Skip to content

Commit 5f97bae

Browse files
authored
Merge pull request #14 from PolymerEl/groupAsObject
added possiblity to have groups as Objects
2 parents b2aaeb3 + c6ef666 commit 5f97bae

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

polymer-sortablejs.html

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
is: "sortable-js",
1313

1414
properties: {
15-
group : { type: String, value: function() { return Math.random(); }, observer: "groupChanged" },
15+
group : { type: Object, value: () => {return {name: Math.random()};}, observer: "groupChanged" },
1616
sort : { type: Boolean, value: true, observer: "sortChanged" },
1717
disabled : { type: Boolean, value: false, observer: "disabledChanged" },
1818
store : { type: Object, value: null, observer: "storeChanged" },
@@ -153,7 +153,12 @@
153153
}
154154
},
155155

156-
groupChanged : function(value) { this.sortable && this.sortable.option("group", value); },
156+
groupChanged : function(value) {
157+
if(typeof(value) === 'string') {
158+
return this.set('group', {name: value});
159+
}
160+
this.sortable && this.sortable.option("group", value );
161+
},
157162
sortChanged : function(value) { this.sortable && this.sortable.option("sort", value); },
158163
disabledChanged : function(value) { this.sortable && this.sortable.option("disabled", value); },
159164
storeChanged : function(value) { this.sortable && this.sortable.option("store", value); },

0 commit comments

Comments
 (0)