diff options
Diffstat (limited to 'js/panels')
-rwxr-xr-x | js/panels/Panel.reel/Panel.html | 3 | ||||
-rwxr-xr-x | js/panels/PanelBase.js | 40 | ||||
-rwxr-xr-x | js/panels/PanelContainer/PanelContainer.reel/PanelContainer.js | 8 | ||||
-rwxr-xr-x | js/panels/Resizer.js | 76 |
4 files changed, 70 insertions, 57 deletions
diff --git a/js/panels/Panel.reel/Panel.html b/js/panels/Panel.reel/Panel.html index 46c8fb91..7556952c 100755 --- a/js/panels/Panel.reel/Panel.html +++ b/js/panels/Panel.reel/Panel.html | |||
@@ -14,7 +14,8 @@ | |||
14 | "properties": { | 14 | "properties": { |
15 | "element": {"#": "resizeBar"}, | 15 | "element": {"#": "resizeBar"}, |
16 | "panel": {"#": "panel"}, | 16 | "panel": {"#": "panel"}, |
17 | "isVertical": true | 17 | "isVertical": true, |
18 | "willSave": false | ||
18 | }, | 19 | }, |
19 | "bindings": { | 20 | "bindings": { |
20 | "ownerId": { | 21 | "ownerId": { |
diff --git a/js/panels/PanelBase.js b/js/panels/PanelBase.js index 03dcd0ee..473de596 100755 --- a/js/panels/PanelBase.js +++ b/js/panels/PanelBase.js | |||
@@ -36,56 +36,55 @@ exports.PanelBase = Montage.create(Component, { | |||
36 | /* | 36 | /* |
37 | if(this.application.ninja.settings.getSetting(this.panelName, "contentHeight")) { | 37 | if(this.application.ninja.settings.getSetting(this.panelName, "contentHeight")) { |
38 | this._contentHeight = this.application.ninja.settings.getSetting(this.panelName, "contentHeight"); | 38 | this._contentHeight = this.application.ninja.settings.getSetting(this.panelName, "contentHeight"); |
39 | } else { | 39 | } */ |
40 | this._contentHeight = this.defaultHeight; | 40 | |
41 | }*/ | ||
42 | this._contentHeight = this.defaultHeight; | 41 | this._contentHeight = this.defaultHeight; |
43 | } | 42 | } |
44 | return this._contentHeight; | 43 | return this._contentHeight; |
45 | }, | 44 | }, |
46 | set: function(value) { | 45 | set: function(value) { |
47 | if (this.minHeight > value) value = this._minHeight; | 46 | if (this.minHeight > value) value = this._minHeight; |
48 | if (this.maxHeight != null) if(this.maxHeight < value) value = this.maxHeight; | 47 | if (this.maxHeight != null) if(this.maxHeight < value) value = this.maxHeight; |
49 | this._contentHeight = value; | 48 | this._contentHeight = value; |
50 | // this.application.ninja.settings.setSetting(this.panelName, "contentHeight", value); | 49 | |
50 | // this.application.ninja.settings.setSetting(this.panelName, "contentHeight", value); | ||
51 | } | 51 | } |
52 | }, | 52 | }, |
53 | forcedCollapse: { | 53 | forcedCollapse: { |
54 | get: function() { | 54 | get: function() { |
55 | if(this._forcedCollapse == null) { | 55 | if(this._forcedCollapse == null) { |
56 | // Old settings | ||
56 | /* | 57 | /* |
57 | if(this.application.Ninja.SettingsManager.getSetting(this.panelName, "isPanelForceCollapsed")) { | 58 | if(this.application.Ninja.SettingsManager.getSetting(this.panelName, "isPanelForceCollapsed")) { |
58 | this._forcedCollapse = this.application.Ninja.SettingsManager.getSetting(this.panelName, "isPanelForceCollapsed"); | 59 | this._forcedCollapse = this.application.Ninja.SettingsManager.getSetting(this.panelName, "isPanelForceCollapsed"); |
59 | } else { | 60 | } */ |
60 | this._forcedCollapse = false; | ||
61 | } | ||
62 | */ | ||
63 | this._forcedCollapse = false; | 61 | this._forcedCollapse = false; |
64 | } | 62 | } |
65 | return this._forcedCollapse; | 63 | return this._forcedCollapse; |
66 | }, | 64 | }, |
67 | set: function(value) { | 65 | set: function(value) { |
68 | this._forcedCollapse = value; | 66 | this._forcedCollapse = value; |
69 | //this.application.Ninja.SettingsManager.setSetting(this.panelName, "isPanelForceCollapsed", value); | 67 | |
68 | // this.application.Ninja.SettingsManager.setSetting(this.panelName, "isPanelForceCollapsed", value); | ||
70 | } | 69 | } |
71 | }, | 70 | }, |
72 | collapsed: { | 71 | collapsed: { |
73 | get: function() { | 72 | get: function() { |
74 | if(this._collapsed == null) { | 73 | if(this._collapsed == null) { |
74 | // Old settings | ||
75 | /* | 75 | /* |
76 | if(this.application.ninja.settings.getSetting(this.panelName, "isPanelCollapsed")) { | 76 | if(this.application.ninja.settings.getSetting(this.panelName, "isPanelCollapsed")) { |
77 | this._collapsed = this.application.ninja.settings.getSetting(this.panelName, "isPanelCollapsed"); | 77 | this._collapsed = this.application.ninja.settings.getSetting(this.panelName, "isPanelCollapsed"); |
78 | } else { | 78 | } */ |
79 | this._collapsed = false; | 79 | |
80 | } | ||
81 | */ | ||
82 | this._collapsed = false; | 80 | this._collapsed = false; |
83 | } | 81 | } |
84 | return this._collapsed; | 82 | return this._collapsed; |
85 | }, | 83 | }, |
86 | set: function(value) { | 84 | set: function(value) { |
87 | this._collapsed = value; | 85 | this._collapsed = value; |
88 | //this.application.ninja.settings.setSetting(this.panelName, "isPanelCollapsed", value); | 86 | |
87 | // this.application.ninja.settings.setSetting(this.panelName, "isPanelCollapsed", value); | ||
89 | } | 88 | } |
90 | }, | 89 | }, |
91 | visible: { | 90 | visible: { |
@@ -95,10 +94,8 @@ exports.PanelBase = Montage.create(Component, { | |||
95 | /* | 94 | /* |
96 | if(typeof(this.application.ninja.settings.getSetting(this.panelName, "visible")) !== "undefined") { | 95 | if(typeof(this.application.ninja.settings.getSetting(this.panelName, "visible")) !== "undefined") { |
97 | this._visible = this.application.ninja.settings.getSetting(this.panelName, "visible"); | 96 | this._visible = this.application.ninja.settings.getSetting(this.panelName, "visible"); |
98 | } else { | 97 | } */ |
99 | this._visible = true; | 98 | |
100 | } | ||
101 | */ | ||
102 | this._visible = true; | 99 | this._visible = true; |
103 | 100 | ||
104 | } | 101 | } |
@@ -112,7 +109,4 @@ exports.PanelBase = Montage.create(Component, { | |||
112 | 109 | ||
113 | } | 110 | } |
114 | } | 111 | } |
115 | |||
116 | // Methods exist in panel.js | ||
117 | |||
118 | }); | 112 | }); |
diff --git a/js/panels/PanelContainer/PanelContainer.reel/PanelContainer.js b/js/panels/PanelContainer/PanelContainer.reel/PanelContainer.js index bdd112c6..3cbd4369 100755 --- a/js/panels/PanelContainer/PanelContainer.reel/PanelContainer.js +++ b/js/panels/PanelContainer/PanelContainer.reel/PanelContainer.js | |||
@@ -63,16 +63,19 @@ exports.PanelContainer = Montage.create(Component, { | |||
63 | value: function() { | 63 | value: function() { |
64 | //Panels Loading | 64 | //Panels Loading |
65 | this.lastOffset = this.element.offsetHeight; | 65 | this.lastOffset = this.element.offsetHeight; |
66 | /* | 66 | |
67 | /* Old Settings | ||
67 | if( this.application.ninja.settings.getSetting(this.element.id, "panelOrder") != null) { | 68 | if( this.application.ninja.settings.getSetting(this.element.id, "panelOrder") != null) { |
68 | this.initPanelOrder = this.application.ninja.settings.getSetting(this.element.id, "panelOrder") | 69 | this.initPanelOrder = this.application.ninja.settings.getSetting(this.element.id, "panelOrder") |
69 | } | 70 | } |
70 | */ | 71 | */ |
72 | |||
71 | // if Panels already loaded no need to load again. | 73 | // if Panels already loaded no need to load again. |
72 | for(var i = 0; i < this.initPanelOrder.length; i++) { | 74 | for(var i = 0; i < this.initPanelOrder.length; i++) { |
73 | this.addPanel(eval(this.initPanelOrder[i])); | 75 | this.addPanel(eval(this.initPanelOrder[i])); |
74 | this.panelOrder.push(this.initPanelOrder[i]); | 76 | this.panelOrder.push(this.initPanelOrder[i]); |
75 | // this.application.ninja.settings.setSetting(this.element.id, "panelOrder", this.panelOrder); | 77 | |
78 | // this.application.ninja.settings.setSetting(this.element.id, "panelOrder", this.panelOrder); | ||
76 | } | 79 | } |
77 | 80 | ||
78 | var hideSplitter = true; | 81 | var hideSplitter = true; |
@@ -331,6 +334,7 @@ exports.PanelContainer = Montage.create(Component, { | |||
331 | this._panels.splice(overed,0, panelRemoved[0]); | 334 | this._panels.splice(overed,0, panelRemoved[0]); |
332 | var panelOrderRemoved = this.panelOrder.splice(selected,1); | 335 | var panelOrderRemoved = this.panelOrder.splice(selected,1); |
333 | this.panelOrder.splice(overed,0, panelOrderRemoved[0]); | 336 | this.panelOrder.splice(overed,0, panelOrderRemoved[0]); |
337 | |||
334 | //this.application.ninja.settings.setSetting(this.element.id, "panelOrder", this.panelOrder); | 338 | //this.application.ninja.settings.setSetting(this.element.id, "panelOrder", this.panelOrder); |
335 | } | 339 | } |
336 | } | 340 | } |
diff --git a/js/panels/Resizer.js b/js/panels/Resizer.js index e9bd4fc0..60fdde4f 100755 --- a/js/panels/Resizer.js +++ b/js/panels/Resizer.js | |||
@@ -8,15 +8,42 @@ var Montage = require("montage/core/core").Montage; | |||
8 | var Component = require("montage/ui/component").Component; | 8 | var Component = require("montage/ui/component").Component; |
9 | 9 | ||
10 | exports.Resizer = Montage.create(Component, { | 10 | exports.Resizer = Montage.create(Component, { |
11 | 11 | ||
12 | version: { | ||
13 | value: "1.0" | ||
14 | }, | ||
15 | |||
12 | hasTemplate: { | 16 | hasTemplate: { |
13 | value: false | 17 | value: false |
14 | }, | 18 | }, |
15 | 19 | ||
20 | // This property might not be needed anymore. | ||
21 | // TODO - Review this once we the the new panels in place | ||
16 | ownerId: { | 22 | ownerId: { |
17 | value: "" | 23 | value: "" |
18 | }, | 24 | }, |
19 | 25 | ||
26 | willSave: { | ||
27 | value: true | ||
28 | }, | ||
29 | |||
30 | _value: { | ||
31 | value: null | ||
32 | }, | ||
33 | |||
34 | value: { | ||
35 | get: function() { | ||
36 | return this._value; | ||
37 | }, | ||
38 | set: function(val) { | ||
39 | this._value = val; | ||
40 | } | ||
41 | }, | ||
42 | |||
43 | redrawStage: { | ||
44 | value:false | ||
45 | }, | ||
46 | |||
20 | _isInversed: { | 47 | _isInversed: { |
21 | value: false | 48 | value: false |
22 | }, | 49 | }, |
@@ -101,7 +128,8 @@ exports.Resizer = Montage.create(Component, { | |||
101 | } else { | 128 | } else { |
102 | this.panel.style.width = ""; | 129 | this.panel.style.width = ""; |
103 | } | 130 | } |
104 | // this.application.ninja.settings.setSetting(this.element.id,"value", ""); | 131 | |
132 | this.application.localStorage.setItem(this.element.getAttribute("data-montage-id"), {"version": this.version, "value": ""}); | ||
105 | } | 133 | } |
106 | }, | 134 | }, |
107 | 135 | ||
@@ -116,8 +144,15 @@ exports.Resizer = Montage.create(Component, { | |||
116 | 144 |