diff options
author | Pushkar Joshi | 2012-03-13 11:36:11 -0700 |
---|---|---|
committer | Pushkar Joshi | 2012-03-13 11:36:11 -0700 |
commit | 6023f7c8258e660388ee33730601f1161f9299e9 (patch) | |
tree | 632484428b398f71b8481aa8e30180895ff2483c /js/components/layout/document-bar.reel | |
parent | 76f2021618c0a6a99a1b855233e353e84ca99467 (diff) | |
parent | 4ad1650f629e7e345eade52ed6dadc233b27cc45 (diff) | |
download | ninja-6023f7c8258e660388ee33730601f1161f9299e9.tar.gz |
Merge branch 'pentool' into brushtool
Diffstat (limited to 'js/components/layout/document-bar.reel')
3 files changed, 34 insertions, 2 deletions
diff --git a/js/components/layout/document-bar.reel/document-bar.css b/js/components/layout/document-bar.reel/document-bar.css index 2a147964..f3e5de07 100755 --- a/js/components/layout/document-bar.reel/document-bar.css +++ b/js/components/layout/document-bar.reel/document-bar.css | |||
@@ -4,8 +4,6 @@ | |||
4 | (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. | 4 | (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. |
5 | </copyright> */ | 5 | </copyright> */ |
6 | .documentBar { | 6 | .documentBar { |
7 | height: 25px; | ||
8 | width: 1000px; | ||
9 | position: relative; | 7 | position: relative; |
10 | overflow: hidden; | 8 | overflow: hidden; |
11 | color: white; | 9 | color: white; |
diff --git a/js/components/layout/document-bar.reel/document-bar.html b/js/components/layout/document-bar.reel/document-bar.html index 48f1423c..bd13f231 100755 --- a/js/components/layout/document-bar.reel/document-bar.html +++ b/js/components/layout/document-bar.reel/document-bar.html | |||
@@ -32,6 +32,20 @@ | |||
32 | } | 32 | } |
33 | }, | 33 | }, |
34 | 34 | ||
35 | "disable": { | ||
36 | "prototype": "montage/ui/condition.reel", | ||
37 | "properties": { | ||
38 | "element": {"#": "disabledCondition"} | ||
39 | }, | ||
40 | "bindings": { | ||
41 | "condition": { | ||
42 | "boundObject": {"@": "owner"}, | ||
43 | "boundObjectPropertyPath": "disabled", | ||
44 | "oneway": true | ||
45 | } | ||
46 | } | ||
47 | }, | ||
48 | |||
35 | "owner": { | 49 | "owner": { |
36 | "module": "js/components/layout/document-bar.reel", | 50 | "module": "js/components/layout/document-bar.reel", |
37 | "name": "DocumentBar", | 51 | "name": "DocumentBar", |
@@ -53,6 +67,7 @@ | |||
53 | <input class="zoomHotText label" id="zoomControlHT"/> | 67 | <input class="zoomHotText label" id="zoomControlHT"/> |
54 | <span class="design-view disable" id="design">Design View</span> | 68 | <span class="design-view disable" id="design">Design View</span> |
55 | <span class="code-view disable" id="code">Code View</span> | 69 | <span class="code-view disable" id="code">Code View</span> |
70 | <div id="disabledCondition" class="panelDisabled"></div> | ||
56 | </div> | 71 | </div> |
57 | </body> | 72 | </body> |
58 | </html> \ No newline at end of file | 73 | </html> \ No newline at end of file |
diff --git a/js/components/layout/document-bar.reel/document-bar.js b/js/components/layout/document-bar.reel/document-bar.js index ea5e3280..4dc39fd6 100755 --- a/js/components/layout/document-bar.reel/document-bar.js +++ b/js/components/layout/document-bar.reel/document-bar.js | |||
@@ -13,6 +13,9 @@ exports.DocumentBar = Montage.create(Component, { | |||
13 | codeView: { value: null, enumerable: false}, | 13 | codeView: { value: null, enumerable: false}, |
14 | zoomControl: { value: null, enumerable: false }, | 14 | zoomControl: { value: null, enumerable: false }, |
15 | _type: { enumerable: false, value: null }, | 15 | _type: { enumerable: false, value: null }, |
16 | disabled: { value: true }, | ||
17 | |||
18 | |||
16 | 19 | ||
17 | type: { | 20 | type: { |
18 | enumerable: false, | 21 | enumerable: false, |
@@ -84,6 +87,8 @@ exports.DocumentBar = Montage.create(Component, { | |||
84 | 87 | ||
85 | prepareForDraw: { | 88 | prepareForDraw: { |
86 | value: function() { | 89 | value: function() { |
90 | this.eventManager.addEventListener( "openDocument", this, false); | ||
91 | this.eventManager.addEventListener( "closeDocument", this, false); | ||
87 | this.designView.addEventListener("click", this, false); | 92 | this.designView.addEventListener("click", this, false); |
88 | this.codeView.addEventListener("click", this, false); | 93 | this.codeView.addEventListener("click", this, false); |
89 | 94 | ||
@@ -99,6 +104,20 @@ exports.DocumentBar = Montage.create(Component, { | |||
99 | } | 104 | } |
100 | }, | 105 | }, |
101 | 106 | ||
107 | handleOpenDocument: { | ||
108 | value: function() { | ||
109 | this.disabled = false; | ||
110 | } | ||
111 | }, | ||
112 | |||
113 | handleCloseDocument: { | ||
114 | value: function() { | ||
115 | if(!this.application.ninja.documentController.activeDocument) { | ||
116 | this.disabled = true; | ||
117 | } | ||
118 | } | ||
119 | }, | ||
120 | |||
102 | handleOnDocumentChanged:{ | 121 | handleOnDocumentChanged:{ |
103 | value:function(event){ | 122 | value:function(event){ |
104 | 123 | ||