aboutsummaryrefslogtreecommitdiff
path: root/js/components/toolbar.reel/toolbar.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/components/toolbar.reel/toolbar.js')
-rw-r--r--js/components/toolbar.reel/toolbar.js40
1 files changed, 35 insertions, 5 deletions
diff --git a/js/components/toolbar.reel/toolbar.js b/js/components/toolbar.reel/toolbar.js
index 79e7ff1f..03edf477 100644
--- a/js/components/toolbar.reel/toolbar.js
+++ b/js/components/toolbar.reel/toolbar.js
@@ -8,20 +8,50 @@ var Montage = require("montage/core/core").Montage,
8 Component = require("montage/ui/component").Component; 8 Component = require("montage/ui/component").Component;
9 9
10exports.Toolbar = Montage.create(Component, { 10exports.Toolbar = Montage.create(Component, {
11 11 _needsButtonProperties : {
12 deserializedFromTemplate : { 12 value: null
13 value: function() { 13 },
14 console.log("toolbar - deserialized"); 14 _buttons : { value: null },
15 buttons : {
16 get: function() {
17 return this._buttons;
18 },
19 set: function(btns) {
20 this._buttons = btns;
21 this._needsButtonProperties = true;
22 console.log("buttons set");
15 } 23 }
16 }, 24 },
17 prepareForDraw : { 25 prepareForDraw : {
18 value: function() { 26 value: function() {
19 console.log("toolbar - prepare for draw"); 27 console.log("toolbar - prepare for draw");
28 if(this._needsButtonProperties) {
29 this.repetition.childComponents.forEach(function(button) {
30 button.identifier = button.sourceObject.identifier;
31 button.addEventListener('action', this.delegate, false);
32 }, this);
33 }
20 } 34 }
21 }, 35 },
22 draw : { 36 draw : {
23 value: function() { 37 value: function() {
24 console.log("toolbar - draw"); 38 console.log("toolbar - draw - repetition ", this.repetition);
39 if(this._needsClass) {
40
41 this.repetition.childComponents.forEach(function(button) {
42 button.element.classList.add('toolbar-' + button.sourceObject.identifier + '-button');
43 }, this);
44 }
45
46 if(this._needsButtonProperties) {
47 this._needsClass = this.needsDraw = true;
48 this._needsButtonProperties = false;
49 }
50
51
25 } 52 }
53 },
54 _needsClass : {
55 value: null
26 } 56 }
27}); \ No newline at end of file 57}); \ No newline at end of file