diff options
author | Jose Antonio Marquez | 2012-03-19 07:52:17 -0700 |
---|---|---|
committer | Jose Antonio Marquez | 2012-03-19 07:52:17 -0700 |
commit | 44b66216531a872f8dba6a11f1cf13c612c90247 (patch) | |
tree | bbc83ea534598ef762e7e52ad7d9e1385656e0b8 /js/controllers/selection-controller.js | |
parent | 9cb68d376870eea3db3636c30e5fa09d9f71c8cf (diff) | |
parent | 44d75ed17d56055ed9dbb8f91867bbdbc68924fa (diff) | |
download | ninja-44b66216531a872f8dba6a11f1cf13c612c90247.tar.gz |
Merge branch 'refs/heads/francoisfrisch-Ninja-Internal' into FileIO-Montage-Components
Diffstat (limited to 'js/controllers/selection-controller.js')
-rwxr-xr-x | js/controllers/selection-controller.js | 25 |
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 | ||
8 | var Montage = require("montage/core/core").Montage, | 8 | var 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 | ||
11 | exports.SelectionController = Montage.create(Component, { | 12 | exports.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 | } |