diff options
Diffstat (limited to 'html/item.js')
-rw-r--r-- | html/item.js | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/html/item.js b/html/item.js index 5a7c625..b210035 100644 --- a/html/item.js +++ b/html/item.js @@ -2,7 +2,7 @@ enyo.kind({ name: "Abcd.Item", kind: enyo.Control, - published: { x: -1, y: -1, z: -1 }, + published: { x: -1, y: -1, z: -1, selected: false }, // Constructor create: function() { @@ -10,6 +10,7 @@ enyo.kind({ this.xChanged(); this.yChanged(); this.zChanged(); + this.selectedChanged(); }, // Localization changed, update @@ -32,6 +33,15 @@ enyo.kind({ if (this.z != -1) this.applyStyle("z-index", this.z); }, + // Selection changed + selectedChanged: function() { + var className = "item"+this.kind.substring(5)+"-selected"; + if (this.selected) + this.addClass(className); + else + this.removeClass(className); + }, + // Change position moveTo: function(x, y) { this.x = x; |