aboutsummaryrefslogtreecommitdiff
path: root/js/components/menu
diff options
context:
space:
mode:
authorhwc4872012-06-13 14:04:09 -0700
committerhwc4872012-06-13 14:04:09 -0700
commit3e481dd581e0305dd8b572ed0d17e86622223464 (patch)
treeaca2b28aa72857a52e047fb94090c34ab8dd1c2c /js/components/menu
parenta7aa51e6b91623772eef54b827616432838b560e (diff)
parent682f4917d6badd105998c3dd84d031c38b51f017 (diff)
downloadninja-3e481dd581e0305dd8b572ed0d17e86622223464.tar.gz
Merge branch 'master' of github.com:Motorola-Mobility/ninja-internal into Textures
Diffstat (limited to 'js/components/menu')
-rwxr-xr-xjs/components/menu/menu-entry.reel/menu-entry.html6
-rwxr-xr-xjs/components/menu/menu-entry.reel/menu-entry.js49
-rwxr-xr-xjs/components/menu/menu-item.reel/menu-item.js15
-rwxr-xr-xjs/components/menu/menu.reel/menu.html14
4 files changed, 69 insertions, 15 deletions
diff --git a/js/components/menu/menu-entry.reel/menu-entry.html b/js/components/menu/menu-entry.reel/menu-entry.html
index f64de3cb..7310545f 100755
--- a/js/components/menu/menu-entry.reel/menu-entry.html
+++ b/js/components/menu/menu-entry.reel/menu-entry.html
@@ -24,8 +24,10 @@
24 "repetition": { 24 "repetition": {
25 "prototype": "montage/ui/repetition.reel", 25 "prototype": "montage/ui/repetition.reel",
26 "properties": { 26 "properties": {
27 "element": { "#": "subEntries" }, 27 "element": { "#": "subEntries" }
28 "contentController": {"@": "entriesController"} 28 },
29 "bindings": {
30 "objects": {"<-": "@owner.data.entries"}
29 } 31 }
30 }, 32 },
31 33
diff --git a/js/components/menu/menu-entry.reel/menu-entry.js b/js/components/menu/menu-entry.reel/menu-entry.js
index 57e6ec87..b9c546ed 100755
--- a/js/components/menu/menu-entry.reel/menu-entry.js
+++ b/js/components/menu/menu-entry.reel/menu-entry.js
@@ -8,18 +8,54 @@ var Montage = require("montage/core/core").Montage;
8var Component = require("montage/ui/component").Component; 8var Component = require("montage/ui/component").Component;
9 9
10exports.MenuEntry = Montage.create(Component, { 10exports.MenuEntry = Montage.create(Component, {
11 topHeader: { value: null }, 11 topHeader: {
12 topHeaderText: { value: null }, 12 value: null,
13 serializable: true
14 },
15
16 topHeaderText: {
17 value: null,
18 serializable: true
19 },
20
21 subEntries: {
22 value: null,
23 serializable: true
24 },
13 25
14 // Reference to the parent Menu component 26 // Reference to the parent Menu component
15 _menu: { 27 _menu: {
16 value: null 28 value: null
17 }, 29 },
18 30
19 data: { 31 menu: {
32 get: function() {
33 return this._menu;
34 },
35 set: function(value) {
36 if(value !== this._menu) {
37 this._menu = value;
38 }
39 },
40 serializable: true
41 },
42
43 _data: {
20 value: null 44 value: null
21 }, 45 },
22 46
47 data: {
48 get: function() {
49 return this._data;
50 },
51 set: function(value) {
52 if(this._data !== value) {
53 this._data = value;
54 }
55 },
56 serializable: true
57 },
58
23 select: { 59 select: {
24 value: function() { 60 value: function() {
25 this.element.classList.add("selected"); 61 this.element.classList.add("selected");
@@ -49,13 +85,16 @@ exports.MenuEntry = Montage.create(Component, {
49 85
50 handleClick: { 86 handleClick: {
51 value: function(event) { 87 value: function(event) {
52 this._menu.toggleActivation(this); 88 // TODO: Hack! Rework this!
89 this.parentComponent.ownerComponent.toggleActivation(this);
90// this._menu.toggleActivation(this);
53 } 91 }
54 }, 92 },
55 93
56 handleMouseover: { 94 handleMouseover: {
57 value: function(event) { 95 value: function(event) {
58 this._menu.activeEntry = this; 96 this.parentComponent.ownerComponent.activeEntry = this;
97// this._menu.activeEntry = this;
59 } 98 }
60 }, 99 },
61 100
diff --git a/js/components/menu/menu-item.reel/menu-item.js b/js/components/menu/menu-item.reel/menu-item.js
index c00c4412..f9a625a3 100755
--- a/js/components/menu/menu-item.reel/menu-item.js
+++ b/js/components/menu/menu-item.reel/menu-item.js
@@ -9,6 +9,21 @@ var Component = require("montage/ui/component").Component;
9 9
10exports.MenuItem = Montage.create(Component, { 10exports.MenuItem = Montage.create(Component, {
11 11
12 itemBackground: {
13 value: null,
14 serializable: true
15 },
16
17 itemText: {
18 value: null,
19 serializable: true
20 },
21
22 subMenu: {
23 value: null,
24 serializable: true
25 },
26
12 data: { 27 data: {
13 value: null 28 value: null
14 }, 29 },
diff --git a/js/components/menu/menu.reel/menu.html b/js/components/menu/menu.reel/menu.html
index f15cf119..f18c1a0f 100755
--- a/js/components/menu/menu.reel/menu.html
+++ b/js/components/menu/menu.reel/menu.html
@@ -31,9 +31,10 @@
31 "repetition": { 31 "repetition": {
32 "prototype": "montage/ui/repetition.reel", 32 "prototype": "montage/ui/repetition.reel",
33 "properties": { 33 "properties": {
34 "element": { "#": "topMenu" }, 34 "element": { "#": "topMenu" }
35 "contentController": {"@": "menuController"}, 35 },
36 "menuComponent": {"@": "owner"} 36 "bindings": {
37 "objects": {"<-": "@menudata.topLevelMenu"}
37 } 38 }
38 }, 39 },
39 40
@@ -43,17 +44,14 @@
43 "element": { "#": "menuItem" } 44 "element": { "#": "menuItem" }
44 }, 45 },
45 "bindings": { 46 "bindings": {
46 "data": {"<-": "@repetition.objectAtCurrentIteration"}, 47 "data": {"<-": "@repetition.objectAtCurrentIteration"}
47 "_menu": {"<-": "@repetition.menuComponent"}
48 } 48 }
49 }, 49 },
50 50
51 "owner": { 51 "owner": {
52 "prototype": "js/components/menu/menu.reel", 52 "prototype": "js/components/menu/menu.reel",
53 "properties": { 53 "properties": {
54 "element": {"#": "mainMenuBar"}, 54 "element": {"#": "mainMenuBar"}
55 "controller": {"@": "menuController"},
56 "rep": {"@": "repetition"}
57 } 55 }
58 } 56 }
59 } 57 }