aboutsummaryrefslogtreecommitdiff
path: root/js/components/menu/menu-item.reel/menu-item.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/components/menu/menu-item.reel/menu-item.js')
-rwxr-xr-xjs/components/menu/menu-item.reel/menu-item.js30
1 files changed, 20 insertions, 10 deletions
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