diff options
author | Eric Guzman | 2012-05-17 17:43:05 -0700 |
---|---|---|
committer | Eric Guzman | 2012-05-17 17:43:05 -0700 |
commit | 458a4598ed64e3d8c6010a216fb7fb4b3c3c87e7 (patch) | |
tree | ee329e409fe28ae54c894b9e27e82e1f85aefc85 /js/ninja.reel/ninja.js | |
parent | 82954f400f7f8609aef0d2bc1f44c9d960907be6 (diff) | |
parent | 52394cdd71bd62c8c109fd135fa146b7183fbd1f (diff) | |
download | ninja-458a4598ed64e3d8c6010a216fb7fb4b3c3c87e7.tar.gz |
Merge branch 'dom-architecture' of github.com:Motorola-Mobility/ninja-internal into CSSPanelUpdates
Conflicts:
js/document/templates/montage-html/default_html.css
js/lib/NJUtils.js
Diffstat (limited to 'js/ninja.reel/ninja.js')
-rwxr-xr-x | js/ninja.reel/ninja.js | 60 |
1 files changed, 22 insertions, 38 deletions
diff --git a/js/ninja.reel/ninja.js b/js/ninja.reel/ninja.js index 1bdd0050..9f0456ae 100755 --- a/js/ninja.reel/ninja.js +++ b/js/ninja.reel/ninja.js | |||
@@ -165,20 +165,25 @@ exports.Ninja = Montage.create(Component, { | |||
165 | this.eventManager.addEventListener( "selectSubTool", this, false); | 165 | this.eventManager.addEventListener( "selectSubTool", this, false); |
166 | this.eventManager.addEventListener( "onOpenDocument", this, false); | 166 | this.eventManager.addEventListener( "onOpenDocument", this, false); |
167 | 167 | ||
168 | this.addEventListener("change@appModel.livePreview", this.executeLivePreview, false); | 168 | this.addPropertyChangeListener("appModel.livePreview", this.executeLivePreview, false); |
169 | this.addEventListener("change@appModel.chromePreview", this.executeChromePreview, false); | 169 | this.addPropertyChangeListener("appModel.chromePreview", this.executeChromePreview, false); |
170 | this.addEventListener("change@appModel.debug", this.toggleDebug, false); | 170 | this.addPropertyChangeListener("appModel.debug", this.toggleDebug, false); |
171 | 171 | ||
172 | NJevent("appLoading"); | 172 | NJevent("appLoading"); |
173 | } | 173 | } |
174 | }, | 174 | }, |
175 | 175 | ||
176 | |||
177 | //////////////////////////////////////////////////////////////////// | ||
178 | //TODO: Expand method to allow other browsers for preview | ||
176 | executeChromePreview: { | 179 | executeChromePreview: { |
177 | value: function () { | 180 | value: function () { |
178 | this.application.ninja.documentController.activeDocument.livePreview(); | 181 | this.application.ninja.documentController.activeDocument.model.browserPreview('chrome'); |
179 | } | 182 | } |
180 | }, | 183 | }, |
181 | 184 | //////////////////////////////////////////////////////////////////// | |
185 | |||
186 | |||
182 | handleResize: { | 187 | handleResize: { |
183 | value: function() { | 188 | value: function() { |
184 | this.stage.resizeCanvases = true; | 189 | this.stage.resizeCanvases = true; |
@@ -279,19 +284,23 @@ exports.Ninja = Montage.create(Component, { | |||
279 | var background, overflow, transitionStopRule; | 284 | var background, overflow, transitionStopRule; |
280 | this.stage.hideCanvas(this.appModel.livePreview); | 285 | this.stage.hideCanvas(this.appModel.livePreview); |
281 | 286 | ||
287 | // TODO: Remove marker for old template: NINJA-STAGE-REWORK | ||
282 | if(this.appModel.livePreview) { | 288 | if(this.appModel.livePreview) { |
283 | background = "#000000"; | 289 | // background = "#000000"; |
284 | overflow = "hidden"; | 290 | // overflow = "hidden"; |
285 | transitionStopRule = "nj-css-garbage-selector"; | 291 | transitionStopRule = "nj-css-garbage-selector"; |
286 | } else { | 292 | } else { |
287 | background = "#808080"; | 293 | // background = "#808080"; |
288 | overflow = "visible"; | 294 | // overflow = "visible"; |
289 | transitionStopRule = "*" | 295 | transitionStopRule = "*" |
290 | } | 296 | } |
291 | 297 | ||
292 | this.currentDocument.documentRoot.elementModel.controller.setProperty(this.currentDocument.documentRoot, "body-background", background); | 298 | // TODO: Remove marker for old template: NINJA-STAGE-REWORK |
293 | this.currentDocument.documentRoot.elementModel.controller.setProperty(this.currentDocument.documentRoot, "overflow", overflow); | 299 | // this.currentDocument.documentRoot.elementModel.controller.setProperty(this.currentDocument.documentRoot, "body-background", background); |
294 | this.currentDocument.documentRoot.elementModel.controller.changeSelector(this.currentDocument.documentRoot, "transitionStopRule", transitionStopRule); | 300 | // this.currentDocument.documentRoot.elementModel.controller.setProperty(this.currentDocument.documentRoot, "overflow", overflow); |
301 | // this.currentDocument.documentRoot.elementModel.controller.changeSelector(this.currentDocument.documentRoot, "transitionStopRule", transitionStopRule); | ||
302 | |||
303 | this.application.ninja.stylesController._stageStylesheet.rules[0].selectorText = transitionStopRule; | ||
295 | 304 | ||
296 | this._toggleWebGlAnimation(this.appModel.livePreview); | 305 | this._toggleWebGlAnimation(this.appModel.livePreview); |
297 | } | 306 | } |
@@ -300,7 +309,7 @@ exports.Ninja = Montage.create(Component, { | |||
300 | // Turn on WebGL animation during preview | 309 | // Turn on WebGL animation during preview |
301 | _toggleWebGlAnimation: { | 310 | _toggleWebGlAnimation: { |
302 | value: function(inLivePreview) { | 311 | value: function(inLivePreview) { |
303 | var glCanvases = this.currentDocument.iframe.contentWindow.document.querySelectorAll('[data-RDGE-id]'), | 312 | var glCanvases = this.currentDocument.model.views.design.iframe.contentWindow.document.querySelectorAll('[data-RDGE-id]'), |
304 | glShapeModel; | 313 | glShapeModel; |
305 | if(glCanvases) { | 314 | if(glCanvases) { |
306 | for(var i = 0, len = glCanvases.length; i<len; i++) { | 315 | for(var i = 0, len = glCanvases.length; i<len; i++) { |
@@ -337,31 +346,6 @@ exports.Ninja = Montage.create(Component, { | |||
337 | } | 346 | } |
338 | }, | 347 | }, |
339 | 348 | ||
340 | _handleAppLoaded: { | ||
341 | value: function(event){ | ||
342 | |||
343 | /* | ||
344 | Object.defineBinding(docBar, "type", { | ||
345 | boundObject: DocumentManagerModule.DocumentManager, | ||
346 | boundObjectPropertyPath: "activeDocument.documentType" | ||
347 | }); | ||
348 | |||
349 | Object.defineBinding(docBar, "currentView", { | ||
350 | boundObject: DocumentManagerModule.DocumentManager, | ||
351 | boundObjectPropertyPath: "activeDocument.currentView", | ||
352 | oneway: false | ||
353 | }); | ||
354 | |||
355 | Object.defineBinding(docBar, "zoomFactor", { | ||
356 | boundObject: DocumentManagerModule.DocumentManager, | ||
357 | boundObjectPropertyPath: "activeDocument.zoomFactor", | ||
358 | oneway: false | ||
359 | }); | ||
360 | */ | ||
361 | |||
362 | } | ||
363 | }, | ||
364 | |||
365 | setupGlobalHelpers: { | 349 | setupGlobalHelpers: { |
366 | value: function() { | 350 | value: function() { |
367 | 351 | ||