diff options
Diffstat (limited to 'js/components/layout/tools-properties.reel/tools-properties.js')
-rwxr-xr-x | js/components/layout/tools-properties.reel/tools-properties.js | 42 |
1 files changed, 34 insertions, 8 deletions
diff --git a/js/components/layout/tools-properties.reel/tools-properties.js b/js/components/layout/tools-properties.reel/tools-properties.js index 47945b58..c25559ae 100755 --- a/js/components/layout/tools-properties.reel/tools-properties.js +++ b/js/components/layout/tools-properties.reel/tools-properties.js | |||
@@ -9,10 +9,43 @@ var Component = require("montage/ui/component").Component; | |||
9 | 9 | ||
10 | exports.ToolsProperties = Montage.create(Component, { | 10 | exports.ToolsProperties = Montage.create(Component, { |
11 | 11 | ||
12 | disabled: { | 12 | _currentDocument: { |
13 | enumerable: false, | ||
14 | value: null | ||
15 | }, | ||
16 | |||
17 | currentDocument: { | ||
18 | enumerable: false, | ||
19 | get: function() { | ||
20 | return this._currentDocument; | ||
21 | }, | ||
22 | set: function(value) { | ||
23 | if (value === this._currentDocument) { | ||
24 | return; | ||
25 | } | ||
26 | |||
27 | this._currentDocument = value; | ||
28 | |||
29 | this.disabled = !this._currentDocument; | ||
30 | |||
31 | } | ||
32 | }, | ||
33 | |||
34 | _disabled: { | ||
13 | value: true | 35 | value: true |
14 | }, | 36 | }, |
15 | 37 | ||
38 | disabled: { | ||
39 | get: function() { | ||
40 | return this._disabled; | ||
41 | }, | ||
42 | set: function(value) { | ||
43 | if(value !== this._disabled) { | ||
44 | this._disabled = value; | ||
45 | } | ||
46 | } | ||
47 | }, | ||
48 | |||
16 | handleCloseDocument: { | 49 | handleCloseDocument: { |
17 | value: function(){ | 50 | value: function(){ |
18 | if(!this.application.ninja.documentController.activeDocument) { | 51 | if(!this.application.ninja.documentController.activeDocument) { |
@@ -21,16 +54,9 @@ exports.ToolsProperties = Montage.create(Component, { | |||
21 | } | 54 | } |
22 | }, | 55 | }, |
23 | 56 | ||
24 | handleOpenDocument: { | ||
25 | value: function() { | ||
26 | this.disabled = false; | ||
27 | } | ||
28 | }, | ||
29 | |||
30 | prepareForDraw: { | 57 | prepareForDraw: { |
31 | enumerable: false, | 58 | enumerable: false, |
32 | value: function() { | 59 | value: function() { |
33 | this.eventManager.addEventListener( "openDocument", this, false); | ||
34 | this.eventManager.addEventListener( "closeDocument", this, false); | 60 | this.eventManager.addEventListener( "closeDocument", this, false); |
35 | } | 61 | } |
36 | }, | 62 | }, |