diff options
Diffstat (limited to 'js/controllers/selection-controller.js')
-rwxr-xr-x | js/controllers/selection-controller.js | 61 |
1 files changed, 35 insertions, 26 deletions
diff --git a/js/controllers/selection-controller.js b/js/controllers/selection-controller.js index 75bffc5c..db8bdf51 100755 --- a/js/controllers/selection-controller.js +++ b/js/controllers/selection-controller.js | |||
@@ -20,6 +20,41 @@ exports.SelectionController = Montage.create(Component, { | |||
20 | } | 20 | } |
21 | }, | 21 | }, |
22 | 22 | ||
23 | _currentDocument: { | ||
24 | value : null, | ||
25 | enumerable : false | ||
26 | }, | ||
27 | |||
28 | currentDocument : { | ||
29 | get : function() { | ||
30 | return this._currentDocument; | ||
31 | }, | ||
32 | set : function(value) { | ||
33 | if (value === this._currentDocument) { | ||
34 | return; | ||
35 | } | ||
36 | |||
37 | this._currentDocument = value; | ||
38 | |||
39 | if(this._currentDocument.currentView === "design") { | ||
40 | |||
41 | /* | ||
42 | this._isDocument = true; | ||
43 | |||
44 | if(currentSelectionArray) { | ||
45 | this.application.ninja.selectedElements = currentSelectionArray; | ||
46 | if(currentSelectionArray.length) { | ||
47 | this._isDocument = false; | ||
48 | NJevent("selectionChange", {"elements": this.application.ninja.selectedElements, "isDocument": this._isDocument}); | ||
49 | } | ||
50 | } | ||
51 | |||
52 | this._selectionContainer = this.application.ninja.currentSelectedContainer; | ||
53 | */ | ||
54 | } | ||
55 | } | ||
56 | }, | ||
57 | |||
23 | /* | 58 | /* |
24 | * Bound property to the ninja currentSelectedContainer | 59 | * Bound property to the ninja currentSelectedContainer |
25 | */ | 60 | */ |
@@ -52,32 +87,6 @@ exports.SelectionController = Montage.create(Component, { | |||
52 | } | 87 | } |
53 | }, | 88 | }, |
54 | 89 | ||
55 | /** | ||
56 | * Get the current document selection array. If nothing is selected the currentSelectionArray should be null | ||
57 | */ | ||
58 | handleOpenDocument: { | ||
59 | value: function() { | ||
60 | // Handle initializing the selection array here. | ||
61 | this.initWithDocument([]); | ||
62 | } | ||
63 | }, | ||
64 | |||
65 | initWithDocument: { | ||
66 | value: function(currentSelectionArray) { | ||
67 | this._isDocument = true; | ||
68 | |||
69 | if(currentSelectionArray) { | ||
70 | this.application.ninja.selectedElements = currentSelectionArray; | ||
71 | if(currentSelectionArray.length) { | ||
72 | this._isDocument = false; | ||
73 | NJevent("selectionChange", {"elements": this.application.ninja.selectedElements, "isDocument": this._isDocument}); | ||
74 | } | ||
75 | } | ||
76 | |||
77 | this._selectionContainer = this.application.ninja.currentSelectedContainer; | ||
78 | } | ||
79 | }, | ||
80 | |||
81 | handleSwitchDocument: { | 90 | handleSwitchDocument: { |
82 | value: function() { | 91 | value: function() { |
83 | // if(this.application.ninja.documentController.activeDocument.currentView === "design"){ | 92 | // if(this.application.ninja.documentController.activeDocument.currentView === "design"){ |