diff options
author | Valerio Virgillito | 2012-05-29 00:34:40 -0700 |
---|---|---|
committer | Valerio Virgillito | 2012-05-29 00:34:40 -0700 |
commit | 4c3aac5eabd93052b1554a03d78235215bb49db4 (patch) | |
tree | fe08f4f6d33d81d602f56daeaec845577fb9d8a5 /js/components/layout/tools-list.reel/tools-list.js | |
parent | 9a66ccad0235484643ef6d821315b11b5be4a93e (diff) | |
download | ninja-4c3aac5eabd93052b1554a03d78235215bb49db4.tar.gz |
document bindings phase 1
- using array controller to bind the current document to all ninja components
- removed open document event
- removed references to the document controller
Signed-off-by: Valerio Virgillito <valerio@motorola.com>
Diffstat (limited to 'js/components/layout/tools-list.reel/tools-list.js')
-rwxr-xr-x | js/components/layout/tools-list.reel/tools-list.js | 39 |
1 files changed, 34 insertions, 5 deletions
diff --git a/js/components/layout/tools-list.reel/tools-list.js b/js/components/layout/tools-list.reel/tools-list.js index a10b6c3e..638aea41 100755 --- a/js/components/layout/tools-list.reel/tools-list.js +++ b/js/components/layout/tools-list.reel/tools-list.js | |||
@@ -26,11 +26,41 @@ exports.ToolsList = Montage.create(Component, { | |||
26 | RotateStageTool3D: { value: null }, | 26 | RotateStageTool3D: { value: null }, |
27 | PanTool: { value: null }, | 27 | PanTool: { value: null }, |
28 | ZoomTool: { value: null }, | 28 | ZoomTool: { value: null }, |
29 | disabled: { value: true}, | ||
30 | 29 | ||
31 | handleOpenDocument: { | 30 | _currentDocument: { |
32 | value: function(){ | 31 | enumerable: false, |
33 | this.disabled = false; | 32 | value: null |
33 | }, | ||
34 | |||
35 | currentDocument: { | ||
36 | enumerable: false, | ||
37 | get: function() { | ||
38 | return this._currentDocument; | ||
39 | }, | ||
40 | set: function(value) { | ||
41 | if (value === this._currentDocument) { | ||
42 | return; | ||
43 | } | ||
44 | |||
45 | this._currentDocument = value; | ||
46 | |||
47 | this.disabled = !this._currentDocument; | ||
48 | |||
49 | } | ||
50 | }, | ||
51 | |||
52 | _disabled: { | ||
53 | value: true | ||
54 | }, | ||
55 | |||
56 | disabled: { | ||
57 | get: function() { | ||
58 | return this._disabled; | ||
59 | }, | ||
60 | set: function(value) { | ||
61 | if(value !== this._disabled) { | ||
62 | this._disabled = value; | ||
63 | } | ||
34 | } | 64 | } |
35 | }, | 65 | }, |
36 | 66 | ||
@@ -45,7 +75,6 @@ exports.ToolsList = Montage.create(Component, { | |||
45 | prepareForDraw: { | 75 | prepareForDraw: { |
46 | enumerable: false, | 76 | enumerable: false, |
47 | value: function() { | 77 | value: function() { |
48 | this.eventManager.addEventListener( "openDocument", this, false); | ||
49 | this.eventManager.addEventListener( "closeDocument", this, false); | 78 | this.eventManager.addEventListener( "closeDocument", this, false); |
50 | this.PenTool.options = this.application.ninja.toolsProperties.shapeProperties.lineProperties;//this.application.Ninja.toolsProperties.penProperties; | 79 | this.PenTool.options = this.application.ninja.toolsProperties.shapeProperties.lineProperties;//this.application.Ninja.toolsProperties.penProperties; |
51 | 80 | ||