aboutsummaryrefslogtreecommitdiff
path: root/js/panels/PanelContainer
diff options
context:
space:
mode:
Diffstat (limited to 'js/panels/PanelContainer')
-rwxr-xr-xjs/panels/PanelContainer/PanelContainer.reel/PanelContainer.html62
-rwxr-xr-xjs/panels/PanelContainer/PanelContainer.reel/PanelContainer.js390
2 files changed, 0 insertions, 452 deletions
diff --git a/js/panels/PanelContainer/PanelContainer.reel/PanelContainer.html b/js/panels/PanelContainer/PanelContainer.reel/PanelContainer.html
deleted file mode 100755
index 5c6ac227..00000000
--- a/js/panels/PanelContainer/PanelContainer.reel/PanelContainer.html
+++ /dev/null
@@ -1,62 +0,0 @@
1<!DOCTYPE html>
2<!-- <copyright>
3 This file contains proprietary software owned by Motorola Mobility, Inc.<br/>
4 No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/>
5 (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved.
6 </copyright> -->
7<html lang="en">
8<head>
9
10 <script type="text/montage-serialization">
11 {
12 "panel": {
13 "module": "js/panels/Panel.reel",
14 "name": "Panel",
15 "properties": {
16 "element": {"#": "panel"}
17 },
18 "bindings": {
19 "panelBase": {
20 "boundObject": {"@": "repetition1"},
21 "boundObjectPropertyPath": "objectAtCurrentIteration",
22 "oneway": true
23 }
24 }
25 },
26
27
28 "repetition1": {
29 "module": "montage/ui/repetition.reel",
30 "name": "Repetition",
31 "properties": {
32 "element": {"#": "panels"}
33 },
34 "bindings": {
35 "objects": {
36 "boundObject": {"@": "owner"},
37 "boundObjectPropertyPath": "_panels",
38 "oneway": true
39 }
40 }
41 },
42
43 "owner": {
44 "module": "js/panels/PanelContainer/PanelContainer.reel",
45 "name": "PanelContainer",
46 "properties": {
47 "element": {"#": "panelContainer"},
48 "repeater": {"@": "repetition1"}
49 }
50 }
51 }
52 </script>
53
54 </head>
55<body>
56 <section id="panelContainer">
57 <article id="panels" class="panels">
58 <article id="panel" class="panel"></article>
59 </article>
60 </section>
61</body>
62</html> \ No newline at end of file
diff --git a/js/panels/PanelContainer/PanelContainer.reel/PanelContainer.js b/js/panels/PanelContainer/PanelContainer.reel/PanelContainer.js
deleted file mode 100755
index 003724bb..00000000
--- a/js/panels/PanelContainer/PanelContainer.reel/PanelContainer.js
+++ /dev/null
@@ -1,390 +0,0 @@
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
7/*
8Panel Container - A container for other panels
9*/
10var Montage = require("montage/core/core").Montage;
11var Component = require("montage/ui/component").Component;
12var PropertiesPanel = require("js/panels/Properties/properties-panel").PropertiesPanel;
13var ColorPanel = require("js/panels/Color/ColorPanel").ColorPanel;
14var CSSPanel = require("js/panels/CSSPanel/CSSPanel").CSSPanel;
15var ComponentsPanel = require("js/panels/Components/ComponentsPanel").ComponentsPanel;
16var ProjectPanel = require("js/panels/Project/ProjectPanel").ProjectPanel;
17var MaterialsPanel = require("js/panels/Materials/MaterialsPanel").MaterialsPanel;
18var PresetsPanel = require("js/panels/presets/presets-panel").PresetsPanel;
19
20exports.PanelContainer = Montage.create(Component, {
21 lastOffset: {
22 value:null
23 },
24 _collapsedHeight: {
25 value: 26
26 },
27 _isFirstAdjustableNonCollapsed: {
28 value:true
29 },
30 _spaceAvailable: {
31 value:null
32 },
33 _panelSelected : {
34 value: null
35 },
36 _isFirstDraw: {
37 value: false
38 },
39 _panels: {
40 value: []
41 },
42
43 skipPanelIndex: {
44 value: null
45 },
46
47 initPanelOrder: {
48 value: ['ColorPanel', 'PropertiesPanel','ComponentsPanel','ProjectPanel','CSSPanel','MaterialsPanel','PresetsPanel']
49 },
50
51 panelOrder: {
52 value: []
53 },
54
55 deserializedFromTemplate : {
56 value: function() {
57 this.eventManager.addEventListener( "appLoaded", this, false);
58
59 }
60 },
61
62 handleAppLoaded: {
63 value: function() {
64 //Panels Loading
65 this.lastOffset = this.element.offsetHeight;
66
67 /* Old Settings
68 if( this.application.ninja.settings.getSetting(this.element.id, "panelOrder") != null) {
69 this.initPanelOrder = this.application.ninja.settings.getSetting(this.element.id, "panelOrder")
70 }
71 */
72
73 // if Panels already loaded no need to load again.
74 for(var i = 0; i < this.initPanelOrder.length; i++) {
75 this.addPanel(eval(this.initPanelOrder[i]));
76 this.panelOrder.push(this.initPanelOrder[i]);
77
78// this.application.ninja.settings.setSetting(this.element.id, "panelOrder", this.panelOrder);
79 }
80
81 var hideSplitter = true;
82
83 var that = this;
84 this._panels.forEach(function(obj) {
85
86 var panelMenuName = obj.panelName.substring(0, obj.panelName.indexOf('/') !== -1 ? obj.panelName.indexOf('/'): obj.panelName.length) + "Panel";
87
88 that.application.ninja.appModel[panelMenuName] = obj.visible;
89
90 if (obj.visible) {
91 hideSplitter = false;
92 }
93 });
94
95 if (hideSplitter) {
96 this.panelSplitter.toggle();
97 this.panelSplitter.disabled = true;
98 }
99
100// this.needsDraw = true;
101
102 this.addEventListener("change@appModel.PropertiesPanel", this, false);
103 this.addEventListener("change@appModel.ProjectPanel", this, false);
104 this.addEventListener("change@appModel.ColorPanel", this, false);
105 this.addEventListener("change@appModel.ComponentsPanel", this, false);
106 this.addEventListener("change@appModel.CSSPanel", this, false);
107 this.addEventListener("change@appModel.MaterialsPanel", this, false);
108 this.addEventListener("change@appModel.PresetsPanel", this, false);
109 }
110 },
111
112 handleEvent: {
113 value: function(e) {
114 this.togglePanel(e.propertyName);
115 }
116 },
117
118 addPanel: {
119 value: function(panel) {
120 if (panel.init) {
121 panel.init();
122 }
123 this._panels.push(panel);
124 if (this.panelSplitter.disabled) {
125 this.panelSplitter.disabled = false;
126 this.panelSplitter.toggle();
127 }
128 }
129 },
130 handlePanelCollapsed: {
131 value: function(e) {
132
133 for(var i=0; i < this._panels.length; i++) {
134 if (e._event.detail.panelBase._uuid == this._panels[i]._uuid) {
135 this.skipPanelIndex = i;
136 this.handlePanelResized(i, true);
137 }
138 }
139 }
140 },
141
142 handlePanelResizedStart : {
143 value: function(e) {
144 for (var i = 0; i < this._panels.length; i++) {
145 if ( e._event.detail.element.parentNode.uuid == this.repeater.childComponents[i].element.uuid) {