aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArmen Kesablyan2012-03-07 16:08:36 -0800
committerArmen Kesablyan2012-03-07 16:08:36 -0800
commit84931583f1da8da29784074978f146b281b8efa3 (patch)
treec51673830f797d760a2e6b4b89f1216cea143b03
parentd18d91946627c53c646a6f167855551a1891f8f4 (diff)
downloadninja-84931583f1da8da29784074978f146b281b8efa3.tar.gz
Disabled state for panels
Signed-off-by: Armen Kesablyan <armen@motorola.com>
-rwxr-xr-xcss/ninja.css2
-rwxr-xr-xjs/panels/Panel.reel/Panel.html20
-rwxr-xr-xjs/panels/Panel.reel/Panel.js4
-rwxr-xr-xjs/panels/PanelContainer.reel/PanelContainer.js22
-rwxr-xr-xscss/imports/scss/_PanelUI.scss14
5 files changed, 58 insertions, 4 deletions
diff --git a/css/ninja.css b/css/ninja.css
index f139c3b9..32514e96 100755
--- a/css/ninja.css
+++ b/css/ninja.css
@@ -655,6 +655,8 @@ body section .dragging { opacity: 0.4; }
655 655
656body .main .dragOver:not(.dragging) { background-color: #917B56; } 656body .main .dragOver:not(.dragging) { background-color: #917B56; }
657 657
658.panelDisabled { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 9999; color: white; text-align: center; line-height: 100px; box-shadow: inset 0 0 14px #111111; background: rgba(30, 30, 30, 0.7); }
659
658.menuBar { width: 100%; border-style: solid; border-width: 1px; height: 22px; color: white; background: #474747; border-color: black; } 660.menuBar { width: 100%; border-style: solid; border-width: 1px; height: 22px; color: white; background: #474747; border-color: black; }
659 661
660.menuBar ul { list-style: none; margin: 0; padding: 0; float: left; cursor: default; } 662.menuBar ul { list-style: none; margin: 0; padding: 0; float: left; cursor: default; }
diff --git a/js/panels/Panel.reel/Panel.html b/js/panels/Panel.reel/Panel.html
index 04e2930a..43b87940 100755
--- a/js/panels/Panel.reel/Panel.html
+++ b/js/panels/Panel.reel/Panel.html
@@ -113,6 +113,21 @@
113 } 113 }
114 }, 114 },
115 115
116 "disabledCondition": {
117 "module": "montage/ui/condition.reel",
118 "name": "Condition",
119 "properties": {
120 "element": {"#": "disabledCondition"}
121 },
122 "bindings": {
123 "condition": {
124 "boundObject": {"@": "owner"},
125 "boundObjectPropertyPath": "disabled",
126 "oneway": true
127 }
128 }
129 },
130
116 "owner": { 131 "owner": {
117 "module": "js/panels/Panel.reel", 132 "module": "js/panels/Panel.reel",
118 "name": "Panel", 133 "name": "Panel",
@@ -136,9 +151,8 @@
136 </div> 151 </div>
137 <div class="panelBody"> 152 <div class="panelBody">
138 <div class="panelBodyContent"> 153 <div class="panelBodyContent">
139 <div id="panelObject" class="panelObjects"> 154 <div id="disabledCondition" class="panelDisabled"></div>
140 155 <div id="panelObject" class="panelObjects"></div>
141 </div>
142 </div> 156 </div>
143 </div> 157 </div>
144 <div id="resizeBar" class="resizeBar"></div> 158 <div id="resizeBar" class="resizeBar"></div>
diff --git a/js/panels/Panel.reel/Panel.js b/js/panels/Panel.reel/Panel.js
index 2b308258..33f9b3a7 100755
--- a/js/panels/Panel.reel/Panel.js
+++ b/js/panels/Panel.reel/Panel.js
@@ -57,6 +57,10 @@ exports.Panel = Montage.create(Component, {
57 value: null 57 value: null
58 }, 58 },
59 59
60 disabled: {
61 value:false
62 },
63
60 collapsed: { 64 collapsed: {
61 get: function() { 65 get: function() {
62 return this._collapsed; 66 return this._collapsed;
diff --git a/js/panels/PanelContainer.reel/PanelContainer.js b/js/panels/PanelContainer.reel/PanelContainer.js
index b285b49d..c40bbc21 100755
--- a/js/panels/PanelContainer.reel/PanelContainer.js
+++ b/js/panels/PanelContainer.reel/PanelContainer.js
@@ -47,7 +47,7 @@ exports.PanelContainer = Montage.create(Component, {
47 this['panel_'+i].flexible = p.flexible; 47 this['panel_'+i].flexible = p.flexible;
48 this['panel_'+i].modulePath = p.modulePath; 48 this['panel_'+i].modulePath = p.modulePath;
49 this['panel_'+i].moduleName = p.moduleName; 49 this['panel_'+i].moduleName = p.moduleName;
50 this['panel_'+i].index = i; 50 this['panel_'+i].disabled = true;
51 51
52 this.currentPanelState[p.name] = {}; 52 this.currentPanelState[p.name] = {};
53 this.currentPanelState.version = "1.0"; 53 this.currentPanelState.version = "1.0";
@@ -65,6 +65,8 @@ exports.PanelContainer = Montage.create(Component, {
65 this.application.localStorage.setItem("panels", this.currentPanelState); 65 this.application.localStorage.setItem("panels", this.currentPanelState);
66 66
67 67
68 this.eventManager.addEventListener( "onOpenDocument", this, false);
69 this.eventManager.addEventListener( "closeDocument", this, false);
68 } 70 }
69 }, 71 },
70 72
@@ -85,6 +87,24 @@ exports.PanelContainer = Montage.create(Component, {
85 this._redrawPanels(null, true); 87 this._redrawPanels(null, true);
86 } 88 }
87 }, 89 },
90
91 handleOnOpenDocument: {
92 value: function(){
93 this.panels.forEach(function(obj) {
94 obj.disabled = false;
95 });
96 }
97 },
98
99 handleCloseDocument: {
100 value: function(){
101 if(!this.application.ninja.documentController.activeDocument) {
102 this.panels.forEach(function(obj) {
103 obj.disabled = true;
104 });
105 }
106 }
107 },
88 108
89 handleDropped: { 109 handleDropped: {
90 value: function(e) { 110 value: function(e) {
diff --git a/scss/imports/scss/_PanelUI.scss b/scss/imports/scss/_PanelUI.scss
index b25871b0..2ac88b1d 100755
--- a/scss/imports/scss/_PanelUI.scss
+++ b/scss/imports/scss/_PanelUI.scss
@@ -1256,3 +1256,17 @@ body .main .dragOver:not(.dragging) {
1256 background-color: #917B56; 1256 background-color: #917B56;
1257} 1257}
1258 1258
1259.panelDisabled {
1260 position: absolute;
1261 top: 0;
1262 left: 0;
1263 width: 100%;
1264 height: 100%;
1265 z-index: 9999;
1266 color: white;
1267 text-align: center;
1268 line-height: 100px;
1269 box-shadow: inset 0 0 14px #111111;
1270
1271 background: rgba(30, 30, 30, 0.7);
1272} \ No newline at end of file