aboutsummaryrefslogtreecommitdiff
path: root/js/controllers/selection-controller.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/controllers/selection-controller.js')
-rwxr-xr-xjs/controllers/selection-controller.js25
1 files changed, 24 insertions, 1 deletions
diff --git a/js/controllers/selection-controller.js b/js/controllers/selection-controller.js
index 154fb7f8..fa82d4cc 100755
--- a/js/controllers/selection-controller.js
+++ b/js/controllers/selection-controller.js
@@ -6,7 +6,8 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot
6 6
7 7
8var Montage = require("montage/core/core").Montage, 8var Montage = require("montage/core/core").Montage,
9 Component = require("montage/ui/component").Component; 9 Component = require("montage/ui/component").Component,
10 NJUtils = require("js/lib/NJUtils").NJUtils;
10 11
11exports.SelectionController = Montage.create(Component, { 12exports.SelectionController = Montage.create(Component, {
12 13
@@ -154,6 +155,28 @@ exports.SelectionController = Montage.create(Component, {
154 this._isDocument = true; 155 this._isDocument = true;
155 } 156 }
156 157
158 if(item && item.controller && !item.elementModel.isComponent) {
159 var componentInfo = Montage.getInfoForObject(item.controller);
160 var componentName = componentInfo.objectName.toLowerCase();
161 switch(componentName) {
162 case "feedreader":
163 NJUtils.makeElementModel(item, "Feed Reader", "component", false);
164 item.elementModel.pi = "FeedReaderPi";
165 item.elementModel.isComponent = true;
166 break;
167 case "map":
168 NJUtils.makeElementModel(item, "Map", "component", false);
169 item.elementModel.pi = "MapPi";
170 item.elementModel.isComponent = true;
171 break;
172 case "youtubechannel":
173 NJUtils.makeElementModel(item, "Youtube Channel", "component", false);
174 item.elementModel.pi = "YoutubeChannelPi";
175 item.elementModel.isComponent = true;
176 break;
177 }
178 }
179
157 NJevent("selectionChange", {"elements": this.application.ninja.selectedElements, "isDocument": this._isDocument} ); 180 NJevent("selectionChange", {"elements": this.application.ninja.selectedElements, "isDocument": this._isDocument} );
158 181
159 } 182 }