aboutsummaryrefslogtreecommitdiff
path: root/js/components/menu/menu-entry.reel/menu-entry.js
diff options
context:
space:
mode:
authorValerio Virgillito2012-07-18 16:24:17 -0700
committerValerio Virgillito2012-07-18 16:24:17 -0700
commit5ae767d4d47d0ed6846c7928ec219a70c3706639 (patch)
tree63051c2c69d436799ce2673e8496360496565c06 /js/components/menu/menu-entry.reel/menu-entry.js
parentc1360b71e30cff1d90d7a3476ff2878821534d39 (diff)
parent6f2e455a77179f81dfd19037c078c158d3e14ee2 (diff)
downloadninja-5ae767d4d47d0ed6846c7928ec219a70c3706639.tar.gz
Merge branch 'menu-fixes' of https://github.com/mencio/ninja into v0.7.1
Diffstat (limited to 'js/components/menu/menu-entry.reel/menu-entry.js')
-rwxr-xr-xjs/components/menu/menu-entry.reel/menu-entry.js140
1 files changed, 0 insertions, 140 deletions
diff --git a/js/components/menu/menu-entry.reel/menu-entry.js b/js/components/menu/menu-entry.reel/menu-entry.js
deleted file mode 100755
index 10b49417..00000000
--- a/js/components/menu/menu-entry.reel/menu-entry.js
+++ /dev/null
@@ -1,140 +0,0 @@
1/* <copyright>
2Copyright (c) 2012, Motorola Mobility LLC.
3All Rights Reserved.
4
5Redistribution and use in source and binary forms, with or without
6modification, are permitted provided that the following conditions are met:
7
8* Redistributions of source code must retain the above copyright notice,
9 this list of conditions and the following disclaimer.
10
11* Redistributions in binary form must reproduce the above copyright notice,
12 this list of conditions and the following disclaimer in the documentation
13 and/or other materials provided with the distribution.
14
15* Neither the name of Motorola Mobility LLC nor the names of its
16 contributors may be used to endorse or promote products derived from this
17 software without specific prior written permission.
18
19THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29POSSIBILITY OF SUCH DAMAGE.
30</copyright> */
31
32var Montage = require("montage/core/core").Montage;
33var Component = require("montage/ui/component").Component;
34
35exports.MenuEntry = Montage.create(Component, {
36 topHeader: {
37 value: null
38 },
39
40 topHeaderText: {
41 value: null
42 },
43
44 subEntries: {
45 value: null
46 },
47
48 // Reference to the parent Menu component
49 _menu: {
50 value: null
51 },
52
53 menu: {
54 get: function() {
55 return this._menu;
56 },
57 set: function(value) {
58 if(value !== this._menu) {
59 this._menu = value;
60 }
61 }
62 },
63
64 _data: {
65 value: null
66 },
67
68 data: {
69 get: function() {
70 return this._data;
71 },
72 set: function(value) {
73 if(this._data !== value) {
74 this._data = value;
75 }
76 }
77 },
78
79 select: {
80 value: function() {
81 this.element.classList.add("selected");
82 this.subEntries.style.display = "block";
83 }
84 },
85
86 deselect: {
87 value: function() {
88 this.element.classList.remove("selected");
89 this.subEntries.style.display = "none";
90 }
91 },
92
93 _menuIsActive: {
94 value: false
95 },
96
97 menuIsActive: {
98 get: function() {
99 return this._menuIsActive;
100 },
101 set: function(value) {
102 if(value) this.element.addEventListener("mouseover", this, false);
103 }
104 },
105
106 toggleOnMenuItemAction: {
107 value: function() {
108 // TODO: Hack! Rework this!
109 //for non menu headers only
110 this.parentComponent.ownerComponent.toggleActivation(this);
111 }
112 },
113
114 captureMousedown: {
115 value: function(event) {
116 // TODO: Hack! Rework this!
117 //for menu headers only
118 if(event.target.getAttribute("data-montage-id") === "topHeaderText"){
119 this.parentComponent.ownerComponent.toggleActivation(this);
120 }
121 }
122 },
123
124 handleMouseover: {
125 value: function(event) {
126 this.parentComponent.ownerComponent.activeEntry = this;
127 }
128 },
129
130 prepareForDraw: {
131 value: function() {
132
133 this.subEntries.style.display = "none";
134
135 this.topHeaderText.innerHTML = this.data.header;
136
137 this.element.addEventListener("mousedown", this, true);
138 }
139 }
140});