aboutsummaryrefslogtreecommitdiff
path: root/js/components/layout/stage-mode.reel/stage-mode.js
diff options
context:
space:
mode:
authorPierre Frisch2011-12-22 07:25:50 -0800
committerValerio Virgillito2012-01-27 11:18:17 -0800
commitb89a7ee8b956c96a1dcee995ea840feddc5d4b27 (patch)
tree0f3136ab0ecdbbbed6a83576581af0a53124d6f1 /js/components/layout/stage-mode.reel/stage-mode.js
parent2401f05d1f4b94d45e4568b81fc73e67b969d980 (diff)
downloadninja-b89a7ee8b956c96a1dcee995ea840feddc5d4b27.tar.gz
First commit of Ninja to ninja-internal
Signed-off-by: Valerio Virgillito <rmwh84@motorola.com>
Diffstat (limited to 'js/components/layout/stage-mode.reel/stage-mode.js')
-rw-r--r--js/components/layout/stage-mode.reel/stage-mode.js52
1 files changed, 52 insertions, 0 deletions
diff --git a/js/components/layout/stage-mode.reel/stage-mode.js b/js/components/layout/stage-mode.reel/stage-mode.js
new file mode 100644
index 00000000..cb42276b
--- /dev/null
+++ b/js/components/layout/stage-mode.reel/stage-mode.js
@@ -0,0 +1,52 @@
1/* <copyright>
2This file contains proprietary software owned by Motorola Mobility, Inc.<br/>
3No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/>
4(c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved.
5</copyright> */
6
7var Montage = require("montage/core/core").Montage,
8 Component = require("montage/ui/component").Component;
9
10exports.StageMode = Montage.create(Component, {
11
12 _livePreview: {
13 value: null
14 },
15
16 livePreview: {
17 get: function() {
18 return this._livePreview;
19 },
20 set: function(value) {
21 if(value !== this._livePreview) {
22 this._livePreview = value;
23 this.needsDraw = true;
24 }
25 }
26 },
27
28 prepareForDraw: {
29 value: function() {
30 this.element.addEventListener("click", this, false);
31 }
32 },
33
34 draw: {
35 value: function() {
36 if(this._livePreview) {
37 this.element.classList.remove("editMode");
38 this.element.classList.add("liveMode");
39
40 } else {
41 this.element.classList.remove("liveMode");
42 this.element.classList.add("editMode");
43 }
44 }
45 },
46
47 handleClick: {
48 value: function(event) {
49 this.livePreview = !this.livePreview;
50 }
51 }
52}); \ No newline at end of file