aboutsummaryrefslogtreecommitdiff
path: root/js/components/menu/menu-item.reel
diff options
context:
space:
mode:
authorhwc4872012-07-09 16:08:02 -0700
committerhwc4872012-07-09 16:08:02 -0700
commit5085d0f67df89a21715308956004164597a6ba79 (patch)
tree2c896163143a66331205a39b0a3b1b45d51bf12a /js/components/menu/menu-item.reel
parent51f1691f792dbda9b740ded8aa0457c9406db156 (diff)
parent84b3327bd92faafab7954b5eb64c7abe24a3fe13 (diff)
downloadninja-5085d0f67df89a21715308956004164597a6ba79.tar.gz
Merge branch 'master' of github.com:Motorola-Mobility/ninja-internal into GridFixes
Conflicts: js/helper-classes/3D/StageLine.js
Diffstat (limited to 'js/components/menu/menu-item.reel')
-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
3 files changed, 23 insertions, 11 deletions
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