diff options
author | Jon Reid | 2012-03-06 18:08:37 -0800 |
---|---|---|
committer | Jon Reid | 2012-03-06 18:08:37 -0800 |
commit | 6056fdb63b5f4690115e63ee50e8d7dac309ba64 (patch) | |
tree | 5fbe386e4c7732fb84b98c9539b186898f076c7b /js/panels/Panel.reel/Panel.js | |
parent | bcfb704b04587f95a13c474cf0598ba90ec3b371 (diff) | |
parent | a12603cfcfe9d82def3b972dcbcc80f1e790ad85 (diff) | |
download | ninja-6056fdb63b5f4690115e63ee50e8d7dac309ba64.tar.gz |
Merge branch 'Timeline-uber' into timeline-serialized
Diffstat (limited to 'js/panels/Panel.reel/Panel.js')
-rwxr-xr-x | js/panels/Panel.reel/Panel.js | 100 |
1 files changed, 60 insertions, 40 deletions
diff --git a/js/panels/Panel.reel/Panel.js b/js/panels/Panel.reel/Panel.js index e0bf3f18..2b308258 100755 --- a/js/panels/Panel.reel/Panel.js +++ b/js/panels/Panel.reel/Panel.js | |||
@@ -9,31 +9,52 @@ var Component = require("montage/ui/component").Component; | |||
9 | 9 | ||
10 | exports.Panel = Montage.create(Component, { | 10 | exports.Panel = Montage.create(Component, { |
11 | 11 | ||
12 | name: { value: "Panel" }, | 12 | name: { |
13 | collapsedHeight: {value: 26}, | 13 | value: "Panel" |
14 | _collapsed: {value: false}, | 14 | }, |
15 | _height: { value: 200 }, | 15 | |
16 | minHeight: {value: 200 }, | 16 | _collapsed: { |
17 | maxHeight: { value: null}, | 17 | value: false |
18 | flexible: {value: true}, | 18 | }, |
19 | _locked: { value: false}, | 19 | |
20 | isResizing: {value: false }, | 20 | _height: { |
21 | resizer: {value: null }, | 21 | value: 200 |
22 | modulePath: {value: null}, | 22 | }, |
23 | moduleName: {value: null}, | 23 | |
24 | _contentComponent: {value: null}, | 24 | minHeight: { |
25 | 25 | value: 200 | |
26 | contentComponent: { | 26 | }, |
27 | get: function() { | 27 | |
28 | return this._contentComponent; | 28 | maxHeight: { |
29 | }, | 29 | value: null |
30 | set: function(val) { | 30 | }, |
31 | if (val !== null && val !== this._contentComponent) { | 31 | |
32 | this.panelContent.content = val; | 32 | flexible: { |
33 | this.panelContent.needsDraw = true; | 33 | value: true |
34 | this._contentComponent = val; | 34 | }, |
35 | } | 35 | |
36 | } | 36 | _locked: { |
37 | value: false | ||
38 | }, | ||
39 | |||
40 | isResizing: { | ||
41 | value: false | ||
42 | }, | ||
43 | |||
44 | _resizedHeight: { | ||
45 | value: 0 | ||
46 | }, | ||
47 | |||
48 | resizer: { | ||
49 | value: null | ||
50 | }, | ||
51 | |||
52 | modulePath: { | ||
53 | value: null | ||
54 | }, | ||
55 | |||
56 | moduleName: { | ||
57 | value: null | ||
37 | }, | 58 | }, |
38 | 59 | ||
39 | collapsed: { | 60 | collapsed: { |
@@ -63,10 +84,6 @@ exports.Panel = Montage.create(Component, { | |||
63 | } | 84 | } |
64 | }, | 85 | }, |
65 | 86 | ||
66 | _resizedHeight: { | ||
67 | value: 0 | ||
68 | }, | ||
69 | |||
70 | locked: { | 87 | locked: { |
71 | get: function() { | 88 | get: function() { |
72 | return this._locked; | 89 | return this._locked; |
@@ -94,17 +111,20 @@ exports.Panel = Montage.create(Component, { | |||
94 | 111 | ||
95 | prepareForDraw: { | 112 | prepareForDraw: { |
96 | value: function() { | 113 | value: function() { |
97 | //TODO: This line should not be here this line hits each time a panel is loaded. Will Need to move to instance call; | 114 | if(this.name === "Color") { |
98 | this.application.ninja.colorController.colorView = this.application.ninja.colorController.colorPanelBase.create(); | 115 | this.application.ninja.colorController.colorView = this.application.ninja.colorController.colorPanelBase.create(); |
99 | var myContent; | 116 | } |
100 | var that = this; | 117 | |
101 | 118 | if(this.modulePath && this.moduleName) { | |
102 | myContent = require.async(this.modulePath) | 119 | // Load the slot content |
103 | .then(function(panelContent) { | 120 | var that = this; |
104 | var componentRequire = panelContent[that.moduleName]; | 121 | require.async(this.modulePath) |
105 | that.contentComponent = componentRequire.create(); | 122 | .then(function(panelContent) { |
106 | }) | 123 | var componentRequire = panelContent[that.moduleName]; |
107 | .end(); | 124 | that.panelContent.content = componentRequire.create(); |
125 | }) | ||
126 | .end(); | ||
127 | } | ||
108 | } | 128 | } |
109 | }, | 129 | }, |
110 | 130 | ||