aboutsummaryrefslogtreecommitdiff
path: root/js/ninja.reel/ninja.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/ninja.reel/ninja.js')
-rwxr-xr-x[-rw-r--r--]js/ninja.reel/ninja.js21
1 files changed, 11 insertions, 10 deletions
diff --git a/js/ninja.reel/ninja.js b/js/ninja.reel/ninja.js
index 469d38f7..6efeef8a 100644..100755
--- a/js/ninja.reel/ninja.js
+++ b/js/ninja.reel/ninja.js
@@ -60,11 +60,18 @@ exports.Ninja = Montage.create(Component, {
60 this.eventManager.addEventListener( "onOpenDocument", this, false); 60 this.eventManager.addEventListener( "onOpenDocument", this, false);
61 61
62 this.addEventListener("change@appModel.livePreview", this.executeLivePreview, false); 62 this.addEventListener("change@appModel.livePreview", this.executeLivePreview, false);
63 this.addEventListener("change@appModel.chromePreview", this.executeChromePreview, false);
63 this.addEventListener("change@appModel.debug", this.toggleDebug, false); 64 this.addEventListener("change@appModel.debug", this.toggleDebug, false);
64 65
65 NJevent("appLoading"); 66 NJevent("appLoading");
66 } 67 }
67 }, 68 },
69
70 executeChromePreview: {
71 value: function () {
72 this.application.ninja.documentController.activeDocument.livePreview();
73 }
74 },
68 75
69 handleResize: { 76 handleResize: {
70 value: function() { 77 value: function() {
@@ -102,6 +109,9 @@ exports.Ninja = Montage.create(Component, {
102 didDraw: { 109 didDraw: {
103 value: function() { 110 value: function() {
104 if(!this._didDraw) { 111 if(!this._didDraw) {
112 if (!this.application.ninja.coreIoApi.ioServiceDetected) {
113 var check = this.application.ninja.coreIoApi.cloudAvailable();
114 }
105 NJevent("appLoaded"); 115 NJevent("appLoaded");
106 this._didDraw = true; 116 this._didDraw = true;
107 } 117 }
@@ -158,19 +168,10 @@ exports.Ninja = Montage.create(Component, {
158 168
159 this.appModel.show3dGrid = this.currentDocument.draw3DGrid; 169 this.appModel.show3dGrid = this.currentDocument.draw3DGrid;
160 170
161 this.currentDocument._document.body.addEventListener("userTemplateDidLoad", this.userTemplateDidLoad.bind(this), false);
162
163
164 NJevent("openDocument"); 171 NJevent("openDocument");
165 } 172 }
166 }, 173 },
167 174
168 userTemplateDidLoad: {
169 value: function(){
170 this.currentSelectedContainer = this.currentDocument.documentRoot;
171 }
172 },
173
174 executeLivePreview: { 175 executeLivePreview: {
175 value: function() { 176 value: function() {
176 var background, overflow, transitionStopRule; 177 var background, overflow, transitionStopRule;
@@ -186,7 +187,7 @@ exports.Ninja = Montage.create(Component, {
186 transitionStopRule = "*" 187 transitionStopRule = "*"
187 } 188 }
188 189
189 this.currentDocument.documentRoot.elementModel.controller.setProperty(this.currentDocument.documentRoot, "background", background); 190 this.currentDocument.documentRoot.elementModel.controller.setProperty(this.currentDocument.documentRoot, "body-background", background);
190 this.currentDocument.documentRoot.elementModel.controller.setProperty(this.currentDocument.documentRoot, "overflow", overflow); 191 this.currentDocument.documentRoot.elementModel.controller.setProperty(this.currentDocument.documentRoot, "overflow", overflow);
191 this.currentDocument.documentRoot.elementModel.controller.changeSelector(this.currentDocument.documentRoot, "transitionStopRule", transitionStopRule); 192 this.currentDocument.documentRoot.elementModel.controller.changeSelector(this.currentDocument.documentRoot, "transitionStopRule", transitionStopRule);
192 193