diff options
author | Valerio Virgillito | 2012-07-17 23:34:57 -0700 |
---|---|---|
committer | Valerio Virgillito | 2012-07-17 23:46:23 -0700 |
commit | b9afa81d391f51ea199fc12278b89bdda883dd97 (patch) | |
tree | 8bb7a58b5fa41e7e0e8fc8b847519a7b4d40f4ca /js/components/menu/menu-entry.reel/menu-entry.js | |
parent | 4f737b24c19ddc02d20f9783b8b080fc6ef11142 (diff) | |
download | ninja-b9afa81d391f51ea199fc12278b89bdda883dd97.tar.gz |
removed left over comments.
Signed-off-by: Valerio Virgillito <valerio@motorola.com>
Diffstat (limited to 'js/components/menu/menu-entry.reel/menu-entry.js')
-rwxr-xr-x | js/components/menu/menu-entry.reel/menu-entry.js | 140 |
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> | ||
2 | Copyright (c) 2012, Motorola Mobility LLC. | ||
3 | All Rights Reserved. | ||
4 | |||
5 | Redistribution and use in source and binary forms, with or without | ||
6 | modification, 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 | |||
19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
21 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
22 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE | ||
23 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
24 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
25 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
26 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
27 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
28 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
29 | POSSIBILITY OF SUCH DAMAGE. | ||
30 | </copyright> */ | ||
31 | |||
32 | var Montage = require("montage/core/core").Montage; | ||
33 | var Component = require("montage/ui/component").Component; | ||
34 | |||
35 | exports.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 | }); | ||