diff options
Diffstat (limited to 'js/lib/NJUtils.js')
-rwxr-xr-x | js/lib/NJUtils.js | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/js/lib/NJUtils.js b/js/lib/NJUtils.js index cb877591..0457120b 100755 --- a/js/lib/NJUtils.js +++ b/js/lib/NJUtils.js | |||
@@ -99,15 +99,45 @@ exports.NJUtils = Object.create(Object.prototype, { | |||
99 | p3d.init(el, true); | 99 | p3d.init(el, true); |
100 | } | 100 | } |
101 | var shapeProps = null; | 101 | var shapeProps = null; |
102 | var pi = controller + "Pi"; | ||
103 | |||
102 | if(isShape) { | 104 | if(isShape) { |
103 | shapeProps = Montage.create(ShapeModel); | 105 | shapeProps = Montage.create(ShapeModel); |
104 | } | 106 | } |
105 | 107 | ||
108 | if(el.controller) { | ||
109 | |||
110 | var componentInfo = Montage.getInfoForObject(el.controller); | ||
111 | var componentName = componentInfo.objectName.toLowerCase(); | ||
112 | |||
113 | controller = "component"; | ||
114 | isShape = false; | ||
115 | |||
116 | switch(componentName) { | ||
117 | case "feedreader": | ||
118 | selection = "Feed Reader"; | ||
119 | pi = "FeedReaderPi"; | ||
120 | break; | ||
121 | case "map": | ||
122 | selection = "Map"; | ||
123 | pi = "MapPi"; | ||
124 | break; | ||
125 | case "youtubechannel": | ||
126 | selection = "Youtube Channel"; | ||
127 | pi = "YoutubeChannelPi"; | ||
128 | break; | ||
129 | case "picasacarousel": | ||
130 | selection = "Picasa Carousel"; | ||
131 | pi = "PicasaCarouselPi"; | ||
132 | break; | ||
133 | } | ||
134 | } | ||
135 | |||
106 | el.elementModel = Montage.create(ElementModel, { | 136 | el.elementModel = Montage.create(ElementModel, { |
107 | type: { value: el.nodeName}, | 137 | type: { value: el.nodeName}, |
108 | selection: { value: selection}, | 138 | selection: { value: selection}, |
109 | controller: { value: ControllerFactory.getController(controller)}, | 139 | controller: { value: ControllerFactory.getController(controller)}, |
110 | pi: { value: controller + "Pi"}, | 140 | pi: { value: pi}, |
111 | props3D: { value: p3d}, | 141 | props3D: { value: p3d}, |
112 | shapeModel: { value: shapeProps} | 142 | shapeModel: { value: shapeProps} |
113 | }); | 143 | }); |