aboutsummaryrefslogtreecommitdiff
path: root/js/components/menu
diff options
context:
space:
mode:
Diffstat (limited to 'js/components/menu')
-rwxr-xr-xjs/components/menu/menu-entry.reel/menu-entry.html2
-rwxr-xr-xjs/components/menu/menu-entry.reel/menu-entry.js13
-rwxr-xr-xjs/components/menu/menu-item.reel/menu-item.css2
-rwxr-xr-xjs/components/menu/menu-item.reel/menu-item.html2
-rwxr-xr-xjs/components/menu/menu-item.reel/menu-item.js30
-rwxr-xr-xjs/components/menu/menu.reel/menu.html4
6 files changed, 38 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 1b64c489..4144cee4 100755
--- a/js/components/menu/menu-entry.reel/menu-entry.html
+++ b/js/components/menu/menu-entry.reel/menu-entry.html
@@ -1,4 +1,4 @@
1<!DOCTYPE html> 1<!doctype html>
2<!-- <copyright> 2<!-- <copyright>
3Copyright (c) 2012, Motorola Mobility, Inc 3Copyright (c) 2012, Motorola Mobility, Inc
4All Rights Reserved. 4All Rights Reserved.
diff --git a/js/components/menu/menu-entry.reel/menu-entry.js b/js/components/menu/menu-entry.reel/menu-entry.js
index 17f847d4..6c49af8f 100755
--- a/js/components/menu/menu-entry.reel/menu-entry.js
+++ b/js/components/menu/menu-entry.reel/menu-entry.js
@@ -102,10 +102,21 @@ exports.MenuEntry = Montage.create(Component, {
102 } 102 }
103 }, 103 },
104 104
105 toggleOnMenuItemAction: {
106 value: function() {
107 // TODO: Hack! Rework this!
108 //for non menu headers only
109 this.parentComponent.ownerComponent.toggleActivation(this);
110 }
111 },
112
105 captureMousedown: { 113 captureMousedown: {
106 value: function(event) { 114 value: function(event) {
107 // TODO: Hack! Rework this! 115 // TODO: Hack! Rework this!
108 this.parentComponent.ownerComponent.toggleActivation(this); 116 //for menu headers only
117 if(event.target.getAttribute("data-montage-id") === "topHeaderText"){
118 this.parentComponent.ownerComponent.toggleActivation(this);
119 }
109 } 120 }
110 }, 121 },
111 122
diff --git a/js/components/menu/menu-item.reel/menu-item.css b/js/components/menu/menu-item.reel/menu-item.css
index 298d706d..59f04675 100755
--- a/js/components/menu/menu-item.reel/menu-item.css
+++ b/js/components/menu/menu-item.reel/menu-item.css
@@ -33,10 +33,12 @@ POSSIBILITY OF SUCH DAMAGE.
33 font-size: 10pt; 33 font-size: 10pt;
34 padding: 3px 12px 3px 8px; 34 padding: 3px 12px 3px 8px;
35 text-shadow : 1px 1px 1px #000000; 35 text-shadow : 1px 1px 1px #000000;
36 cursor:pointer;
36} 37}
37 38
38.menuItem:hover { 39.menuItem:hover {
39 background-color: #7f7f7f; 40 background-color: #7f7f7f;
41 cursor:pointer;
40} 42}
41 43
42.menubg .subEntries { 44.menubg .subEntries {
diff --git a/js/components/menu/menu-item.reel/menu-item.html b/js/components/menu/menu-item.reel/menu-item.html
index ce46d857..9d507c86 100755
--- a/js/components/menu/menu-item.reel/menu-item.html
+++ b/js/components/menu/menu-item.reel/menu-item.html
@@ -1,4 +1,4 @@
1<!DOCTYPE html> 1<!doctype html>
2<!-- <copyright> 2<!-- <copyright>
3Copyright (c) 2012, Motorola Mobility, Inc 3Copyright (c) 2012, Motorola Mobility, Inc
4All Rights Reserved. 4All Rights Reserved.
diff --git a/js/components/menu/menu-item.reel/menu-item.js b/js/components/menu/menu-item.reel/menu-item.js
index 320611c5..fbac149c 100755
--- a/js/components/menu/menu-item.reel/menu-item.js
+++ b/js/components/menu/menu-item.reel/menu-item.js
@@ -120,18 +120,15 @@ exports.MenuItem = Montage.create(Component, {
120 120
121 if(this.data.submenu) { 121 if(this.data.submenu) {
122 this.submenu = true; 122 this.submenu = true;
123
124 this.subentries = this.data.entries; 123 this.subentries = this.data.entries;
125
126 this.subMenu.classList.add("subMenu"); 124 this.subMenu.classList.add("subMenu");
127 this.element.addEventListener("mouseover", this, false);
128 this.element.addEventListener("mouseout", this, false);
129
130 } 125 }
131 126
127 this.element.addEventListener("mouseover", this, false);
128 this.element.addEventListener("mouseout", this, false);
132 129
133 this.itemText.innerHTML = this.data.displayText; 130 this.itemText.innerHTML = this.data.displayText;
134 this.element.addEventListener("mousedown", this, true); 131 this.element.addEventListener("mouseup", this, true);
135 } 132 }
136 }, 133 },
137 134
@@ -156,10 +153,13 @@ exports.MenuItem = Montage.create(Component, {
156 } 153 }
157 }, 154 },
158 155
159 captureMousedown: { 156 captureMouseup: {
160 value: function(event) { 157 value: function(event) {
161 158
162 if(this.data.radio && this.checked) return; 159 if(this.data.radio && this.checked){
160 this.parentComponent.ownerComponent.toggleOnMenuItemAction();
161 return;
162 }
163 163
164 if( ( this.enabled === true || this.enabled > 0 ) && (this.submenu === false) ) { 164 if( ( this.enabled === true || this.enabled > 0 ) && (this.submenu === false) ) {
165 if(this.data.action) { 165 if(this.data.action) {
@@ -167,6 +167,7 @@ exports.MenuItem = Montage.create(Component, {
167 } else if(this.checked !== null) { 167 } else if(this.checked !== null) {
168 this.checked = !this.checked; 168 this.checked = !this.checked;
169 } 169 }
170 this.parentComponent.ownerComponent.toggleOnMenuItemAction();
170 } 171 }
171 172
172 } 173 }
@@ -174,13 +175,22 @@ exports.MenuItem = Montage.create(Component, {
174 175
175 handleMouseover: { 176 handleMouseover: {
176 value: function() { 177 value: function() {
177 if(this.enabled) this.subMenu.style.display = "block"; 178 if(this.enabled){
179 this.element.style.backgroundColor = "#7f7f7f";
180 this.element.style.cursor = "pointer";
181 if(this.data.submenu) {
182 this.subMenu.style.display = "block";
183 }
184 }
178 } 185 }
179 }, 186 },
180 187
181 handleMouseout: { 188 handleMouseout: {
182 value: function() { 189 value: function() {
183 this.subMenu.style.display = "none"; 190 this.element.style.backgroundColor = "#474747";
191 if(this.data.submenu) {
192 this.subMenu.style.display = "none";
193 }
184 } 194 }
185 } 195 }
186 196
diff --git a/js/components/menu/menu.reel/menu.html b/js/components/menu/menu.reel/menu.html
index 6c74ac6a..c4a42c0a 100755
--- a/js/components/menu/menu.reel/menu.html
+++ b/js/components/menu/menu.reel/menu.html
@@ -1,4 +1,4 @@
1<!DOCTYPE html> 1<!doctype html>
2<!-- <copyright> 2<!-- <copyright>
3Copyright (c) 2012, Motorola Mobility, Inc 3Copyright (c) 2012, Motorola Mobility, Inc
4All Rights Reserved. 4All Rights Reserved.
@@ -72,7 +72,7 @@ POSSIBILITY OF SUCH DAMAGE.
72 "menuIsActive": {"<-": "@owner.active"} 72 "menuIsActive": {"<-": "@owner.active"}
73 } 73 }
74 }, 74 },
75 75
76 "owner": { 76 "owner": {
77 "prototype": "js/components/menu/menu.reel", 77 "prototype": "js/components/menu/menu.reel",
78 "properties": { 78 "properties": {