diff options
Diffstat (limited to 'js/panels/Components/ComponentsPanelBase.reel')
-rw-r--r-- | js/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.html | 11 | ||||
-rw-r--r-- | js/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.js | 29 |
2 files changed, 36 insertions, 4 deletions
diff --git a/js/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.html b/js/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.html index df104ecc..1e040e35 100644 --- a/js/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.html +++ b/js/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.html | |||
@@ -11,6 +11,17 @@ | |||
11 | 11 | ||
12 | <script type="text/montage-serialization"> | 12 | <script type="text/montage-serialization"> |
13 | { | 13 | { |
14 | "componentController": { | ||
15 | "module": "montage/ui/controller/array-controller", | ||
16 | "name": "ArrayController", | ||
17 | "bindings": { | ||
18 | "content": { | ||
19 | "boundObject": {"@": "owner"}, | ||
20 | "boundObjectPropertyPath": "components" | ||
21 | } | ||
22 | } | ||
23 | }, | ||
24 | |||
14 | "owner": { | 25 | "owner": { |
15 | "module": "js/panels/Components/ComponentsPanelBase.reel", | 26 | "module": "js/panels/Components/ComponentsPanelBase.reel", |
16 | "name": "ComponentsPanelBase", | 27 | "name": "ComponentsPanelBase", |
diff --git a/js/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.js b/js/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.js index 58a798d8..9b5b755c 100644 --- a/js/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.js +++ b/js/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.js | |||
@@ -11,10 +11,25 @@ var Montage = require("montage/core/core").Montage, | |||
11 | var treeControlModule = require("js/components/tree.reel"); | 11 | var treeControlModule = require("js/components/tree.reel"); |
12 | 12 | ||
13 | var ComponentsPanelBase = exports.ComponentsPanelBase = Montage.create(Component, { | 13 | var ComponentsPanelBase = exports.ComponentsPanelBase = Montage.create(Component, { |
14 | _hasFocus: { | 14 | |
15 | enumerable: false, | 15 | components: { |
16 | value: false | 16 | value: null |
17 | }, | ||
18 | |||
19 | didCreate: { | ||
20 | value: function() { | ||
21 | this._loadComponents(); | ||
22 | } | ||
23 | }, | ||
24 | |||
25 | _loadComponents: { | ||
26 | value: function() { | ||
27 | this.photos = [ | ||
28 | {component: "Button", data: "montage/ui/button.reel/button.json"} | ||
29 | ]; | ||
30 | } | ||
17 | }, | 31 | }, |
32 | |||
18 | prepareForDraw: { | 33 | prepareForDraw: { |
19 | enumerable: false, | 34 | enumerable: false, |
20 | value: function() { | 35 | value: function() { |
@@ -57,7 +72,7 @@ var ComponentsPanelBase = exports.ComponentsPanelBase = Montage.create(Component | |||
57 | componentEl.setAttribute("type", "button"); | 72 | componentEl.setAttribute("type", "button"); |
58 | //componentEl.innerHTML = "Button"; | 73 | //componentEl.innerHTML = "Button"; |
59 | 74 | ||
60 | componentInstance = this.application.ninja.currentDocument._window.addComponent(componentEl, {type: componentType, path: "montage/ui/button.reel", name: "Button"}); | 75 | componentInstance = this.application.ninja.currentDocument._window.addComponent(componentEl, {type: componentType, path: "montage/ui/button.reel", name: "Button"}, this.callback); |
61 | 76 | ||
62 | 77 | ||
63 | }else if(componentType == "Checkbox"){ | 78 | }else if(componentType == "Checkbox"){ |
@@ -140,5 +155,11 @@ var ComponentsPanelBase = exports.ComponentsPanelBase = Montage.create(Component | |||
140 | 155 | ||
141 | 156 | ||
142 | } | 157 | } |
158 | }, | ||
159 | |||
160 | callback: { | ||
161 | value: function() { | ||
162 | console.log("the callback"); | ||
163 | } | ||
143 | } | 164 | } |
144 | }); \ No newline at end of file | 165 | }); \ No newline at end of file |