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 3a5bf4ab..cad833a0 100755
--- a/js/components/menu/menu-item.reel/menu-item.js
+++ b/js/components/menu/menu-item.reel/menu-item.js
@@ -96,18 +96,15 @@ exports.MenuItem = Montage.create(Component, {
96 96
97 if(this.data.submenu) { 97 if(this.data.submenu) {
98 this.submenu = true; 98 this.submenu = true;
99
100 this.subentries = this.data.entries; 99 this.subentries = this.data.entries;
101
102 this.subMenu.classList.add("subMenu"); 100 this.subMenu.classList.add("subMenu");
103 this.element.addEventListener("mouseover", this, false);
104 this.element.addEventListener("mouseout", this, false);
105
106 } 101 }
107 102
103 this.element.addEventListener("mouseover", this, false);
104 this.element.addEventListener("mouseout", this, false);
108 105
109 this.itemText.innerHTML = this.data.displayText; 106 this.itemText.innerHTML = this.data.displayText;
110 this.element.addEventListener("mousedown", this, true); 107 this.element.addEventListener("mouseup", this, true);
111 } 108 }
112 }, 109 },
113 110
@@ -132,10 +129,13 @@ exports.MenuItem = Montage.create(Component, {
132 } 129 }
133 }, 130 },
134 131
135 captureMousedown: { 132 captureMouseup: {
136 value: function(event) { 133 value: function(event) {
137 134
138 if(this.data.radio && this.checked) return; 135 if(this.data.radio && this.checked){
136 this.parentComponent.ownerComponent.toggleOnMenuItemAction();
137 return;
138 }
139 139
140 if( ( this.enabled === true || this.enabled > 0 ) && (this.submenu === false) ) { 140 if( ( this.enabled === true || this.enabled > 0 ) && (this.submenu === false) ) {
141 if(this.data.action) { 141 if(this.data.action) {
@@ -143,6 +143,7 @@ exports.MenuItem = Montage.create(Component, {
143 } else if(this.checked !== null) { 143 } else if(this.checked !== null) {
144 this.checked = !this.checked; 144 this.checked = !this.checked;
145 } 145 }
146 this.parentComponent.ownerComponent.toggleOnMenuItemAction();
146 } 147 }
147 148
148 } 149 }
@@ -150,13 +151,22 @@ exports.MenuItem = Montage.create(Component, {
150 151
151 handleMouseover: { 152 handleMouseover: {
152 value: function() { 153 value: function() {
153 if(this.enabled) this.subMenu.style.display = "block"; 154 if(this.enabled){
155 this.element.style.backgroundColor = "#7f7f7f";
156 this.element.style.cursor = "pointer";
157 if(this.data.submenu) {
158 this.subMenu.style.display = "block";
159 }
160 }
154 } 161 }
155 }, 162 },
156 163
157 handleMouseout: { 164 handleMouseout: {
158 value: function() { 165 value: function() {
159 this.subMenu.style.display = "none"; 166 this.element.style.backgroundColor = "#474747";
167 if(this.data.submenu) {
168 this.subMenu.style.display = "none";
169 }
160 } 170 }
161 } 171 }
162 172