From 44d75ed17d56055ed9dbb8f91867bbdbc68924fa Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Sun, 18 Mar 2012 22:21:14 -0700 Subject: fixing the selection of components. Temporary workaround for now. Signed-off-by: Valerio Virgillito --- js/controllers/selection-controller.js | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'js/controllers/selection-controller.js') 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 var Montage = require("montage/core/core").Montage, - Component = require("montage/ui/component").Component; + Component = require("montage/ui/component").Component, + NJUtils = require("js/lib/NJUtils").NJUtils; exports.SelectionController = Montage.create(Component, { @@ -154,6 +155,28 @@ exports.SelectionController = Montage.create(Component, { this._isDocument = true; } + if(item && item.controller && !item.elementModel.isComponent) { + var componentInfo = Montage.getInfoForObject(item.controller); + var componentName = componentInfo.objectName.toLowerCase(); + switch(componentName) { + case "feedreader": + NJUtils.makeElementModel(item, "Feed Reader", "component", false); + item.elementModel.pi = "FeedReaderPi"; + item.elementModel.isComponent = true; + break; + case "map": + NJUtils.makeElementModel(item, "Map", "component", false); + item.elementModel.pi = "MapPi"; + item.elementModel.isComponent = true; + break; + case "youtubechannel": + NJUtils.makeElementModel(item, "Youtube Channel", "component", false); + item.elementModel.pi = "YoutubeChannelPi"; + item.elementModel.isComponent = true; + break; + } + } + NJevent("selectionChange", {"elements": this.application.ninja.selectedElements, "isDocument": this._isDocument} ); } -- cgit v1.2.3 From f9e31800b1dedd7904e6e23c575c94ed4a72abdb Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Mon, 19 Mar 2012 15:23:08 -0700 Subject: fixing the selection for the picasa carousel Signed-off-by: Valerio Virgillito --- js/controllers/selection-controller.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'js/controllers/selection-controller.js') diff --git a/js/controllers/selection-controller.js b/js/controllers/selection-controller.js index fa82d4cc..5091f99a 100755 --- a/js/controllers/selection-controller.js +++ b/js/controllers/selection-controller.js @@ -174,6 +174,11 @@ exports.SelectionController = Montage.create(Component, { item.elementModel.pi = "YoutubeChannelPi"; item.elementModel.isComponent = true; break; + case "picasacarousel": + NJUtils.makeElementModel(item, "Picasa Carousel", "component", false); + item.elementModel.pi = "PicasaCarouselPi"; + item.elementModel.isComponent = true; + break; } } -- cgit v1.2.3 From c0a1164b5e84098e005f076de5eddd0e60387286 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Tue, 20 Mar 2012 14:21:29 -0700 Subject: Fixing the selection issues Signed-off-by: Valerio Virgillito --- js/controllers/selection-controller.js | 27 --------------------------- 1 file changed, 27 deletions(-) (limited to 'js/controllers/selection-controller.js') diff --git a/js/controllers/selection-controller.js b/js/controllers/selection-controller.js index 5091f99a..9b0e638a 100755 --- a/js/controllers/selection-controller.js +++ b/js/controllers/selection-controller.js @@ -155,33 +155,6 @@ exports.SelectionController = Montage.create(Component, { this._isDocument = true; } - if(item && item.controller && !item.elementModel.isComponent) { - var componentInfo = Montage.getInfoForObject(item.controller); - var componentName = componentInfo.objectName.toLowerCase(); - switch(componentName) { - case "feedreader": - NJUtils.makeElementModel(item, "Feed Reader", "component", false); - item.elementModel.pi = "FeedReaderPi"; - item.elementModel.isComponent = true; - break; - case "map": - NJUtils.makeElementModel(item, "Map", "component", false); - item.elementModel.pi = "MapPi"; - item.elementModel.isComponent = true; - break; - case "youtubechannel": - NJUtils.makeElementModel(item, "Youtube Channel", "component", false); - item.elementModel.pi = "YoutubeChannelPi"; - item.elementModel.isComponent = true; - break; - case "picasacarousel": - NJUtils.makeElementModel(item, "Picasa Carousel", "component", false); - item.elementModel.pi = "PicasaCarouselPi"; - item.elementModel.isComponent = true; - break; - } - } - NJevent("selectionChange", {"elements": this.application.ninja.selectedElements, "isDocument": this._isDocument} ); } -- cgit v1.2.3 From fdeed8051c3af538d28ca3bc599121cea483c22c Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Thu, 22 Mar 2012 15:47:56 -0700 Subject: Squashed commit of the following GL integration Signed-off-by: Valerio Virgillito --- js/controllers/selection-controller.js | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'js/controllers/selection-controller.js') diff --git a/js/controllers/selection-controller.js b/js/controllers/selection-controller.js index 9b0e638a..53cca029 100755 --- a/js/controllers/selection-controller.js +++ b/js/controllers/selection-controller.js @@ -112,6 +112,15 @@ exports.SelectionController = Montage.create(Component, { if(!this._isDocument) { if(this.findSelectedElement(event.detail) !== -1) { this.executeSelectElement(); + var element = event.detail; + if (element) { + if (element.elementModel) { + if (element.elementModel.shapeModel) { + if (element.elementModel.shapeModel.GLWorld) + element.elementModel.shapeModel.GLWorld.clearTree(); + } + } + } } } } -- cgit v1.2.3