Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/html/item.js
diff options
context:
space:
mode:
Diffstat (limited to 'html/item.js')
-rw-r--r--html/item.js12
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;