aboutsummaryrefslogtreecommitdiff
path: root/js/panels/PanelContainer/PanelContainer.reel
diff options
context:
space:
mode:
authorEric Guzman2012-03-12 15:33:04 -0700
committerEric Guzman2012-03-12 15:33:04 -0700
commit7e3161153b87b891875ac65368a19aed12909fa3 (patch)
treeb80f48d711a9729fc39dbbdff28c4f0620e7302d /js/panels/PanelContainer/PanelContainer.reel
parent7a28932ba8a7517bbaaabe1f5edf678416aafc9c (diff)
parent69d90467865a1384725b2301901be2180c5a841f (diff)
downloadninja-7e3161153b87b891875ac65368a19aed12909fa3.tar.gz
Merge branch 'refs/heads/master' into CSSPanelUpdates
Conflicts: js/panels/PanelContainer/PanelContainer.reel/PanelContainer.js
Diffstat (limited to 'js/panels/PanelContainer/PanelContainer.reel')
-rwxr-xr-xjs/panels/PanelContainer/PanelContainer.reel/PanelContainer.html62
-rwxr-xr-xjs/panels/PanelContainer/PanelContainer.reel/PanelContainer.js392
2 files changed, 0 insertions, 454 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 54320eef..00000000
--- a/js/panels/PanelContainer/PanelContainer.reel/PanelContainer.js
+++ /dev/null
@@ -1,392 +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;
19var CSSPanelNew = require("js/panels/css-panel/css-panel-container").CSSPanelContainer;
20
21exports.PanelContainer = Montage.create(Component, {
22 lastOffset: {
23 value:null
24 },
25 _collapsedHeight: {
26 value: 26
27 },
28 _isFirstAdjustableNonCollapsed: {
29 value:true
30 },
31 _spaceAvailable: {
32 value:null
33 },
34 _panelSelected : {
35 value: null
36 },
37 _isFirstDraw: {
38 value: false
39 },
40 _panels: {
41 value: []
42 },
43
44 skipPanelIndex: {
45 value: null
46 },
47
48 initPanelOrder: {
49 value: ['CSSPanelNew','PropertiesPanel','ColorPanel','ComponentsPanel','ProjectPanel','CSSPanel','MaterialsPanel','PresetsPanel']
50 },
51
52 panelOrder: {
53 value: []
54 },
55
56 deserializedFromTemplate : {
57 value: function() {
58 this.eventManager.addEventListener( "appLoaded", this, false);
59
60 }
61 },
62
63 handleAppLoaded: {
64 value: function() {
65 //Panels Loading
66 this.lastOffset = this.element.offsetHeight;
67
68 /* Old Settings
69 if( this.application.ninja.settings.getSetting(this.element.id, "panelOrder") != null) {
70 this.initPanelOrder = this.application.ninja.settings.getSetting(this.element.id, "panelOrder")
71 }
72 */
73
74 // if Panels already loaded no need to load again.
75 for(var i = 0; i < this.initPanelOrder.length; i++) {
76 this.addPanel(eval(this.initPanelOrder[i]));
77 this.panelOrder.push(this.initPanelOrder[i]);
78
79// this.application.ninja.settings.setSetting(this.element.id, "panelOrder", this.panelOrder);
80 }
81
82 var hideSplitter = true;
83
84 var that = this;
85 this._panels.forEach(function(obj) {
86
87 var panelMenuName = obj.panelName.substring(0, obj.panelName.indexOf('/') !== -1 ? obj.panelName.indexOf('/'): obj.panelName.length) + "Panel";
88
89 that.application.ninja.appModel[panelMenuName] = obj.visible;
90
91 if (obj.visible) {
92 hideSplitter = false;
93 }
94 });
95
96 if (hideSplitter) {
97 this.panelSplitter.toggle();
98 this.panelSplitter.disabled = true;
99 }
100
101// this.needsDraw = true;
102
103 this.addEventListener("change@appModel.PropertiesPanel", this, false);
104 this.addEventListener("change@appModel.ProjectPanel", this, false);
105 this.addEventListener("change@appModel.ColorPanel", this, false);
106 this.addEventListener("change@appModel.ComponentsPanel", this, false);
107 this.addEventListener("change@appModel.CSSPanel", this, false);
108 this.addEventListener("change@appModel.MaterialsPanel", this, false);
109 this.addEventListener("change@appModel.PresetsPanel", this, false);
110 this.addEventListener("change@appModel.CSSPanelNew", this, false);
111 }
112 },
113
114 handleEvent: {
115 value: function(e) {
116 this.togglePanel(e.propertyName);
117 }
118 },
119
120 addPanel: {
121 value: function(panel) {
122 if (panel.init) {
123 panel.init();
124 }
125 this._panels.push(panel);
126 if (this.panelSplitter.disabled) {
127 this.panelSplitter.disabled = false;
128 this.panelSplitter.toggle();
129 }
130 }
131 },
132 handlePanelCollapsed: {
133 value: function(e) {
134
135 for(var i=0; i < this._panels.length; i++) {
136 if (e._event.detail.panelBase._uuid == this._panels[i]._uuid) {
137 this.skipPanelIndex = i;
138 this.handlePanelResized(i, true);
139<