aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Antonio Marquez2012-03-06 11:24:25 -0800
committerJose Antonio Marquez2012-03-06 11:24:25 -0800
commit7271c25bf34917b1751f433d284f21485057425b (patch)
treef14f55c30eef561b02aafacf1aa9ceffc82570e1
parent3c4967fa93b3abc529fc404115707307ba72d5cd (diff)
downloadninja-7271c25bf34917b1751f433d284f21485057425b.tar.gz
Fixing WebGL not available bug
-rwxr-xr-xjs/document/html-document.js6
-rw-r--r--js/mediators/io-mediator.js4
2 files changed, 6 insertions, 4 deletions
diff --git a/js/document/html-document.js b/js/document/html-document.js
index 3f39c4df..80930af2 100755
--- a/js/document/html-document.js
+++ b/js/document/html-document.js
@@ -770,7 +770,8 @@ exports.HTMLDocument = Montage.create(TextDocument, {
770 } 770 }
771 } 771 }
772 } 772 }
773 return {mode: 'html', document: this._userDocument, webgl: this.glData, styles: styles, head: this._templateDocument.head.innerHTML, body: this._templateDocument.body.innerHTML}; 773 //return {mode: 'html', document: this._userDocument, webgl: this.glData, styles: styles, head: this._templateDocument.head.innerHTML, body: this._templateDocument.body.innerHTML};
774 return {mode: 'html', document: this._userDocument, styles: styles, head: this._templateDocument.head.innerHTML, body: this._templateDocument.body.innerHTML};
774 } else if (this.currentView === "code"){ 775 } else if (this.currentView === "code"){
775 //TODO: Would this get call when we are in code of HTML? 776 //TODO: Would this get call when we are in code of HTML?
776 } else { 777 } else {
@@ -793,7 +794,8 @@ exports.HTMLDocument = Montage.create(TextDocument, {
793 } 794 }
794 } 795 }
795 } 796 }
796 return {mode: 'html', document: this._userDocument, webgl: this.glData, css: css, head: this._templateDocument.head.innerHTML, body: this._templateDocument.body.innerHTML}; 797 //return {mode: 'html', document: this._userDocument, webgl: this.glData, css: css, head: this._templateDocument.head.innerHTML, body: this._templateDocument.body.innerHTML};
798 return {mode: 'html', document: this._userDocument, css: css, head: this._templateDocument.head.innerHTML, body: this._templateDocument.body.innerHTML};
797 } else if (this.currentView === "code"){ 799 } else if (this.currentView === "code"){
798 //TODO: Would this get call when we are in code of HTML? 800 //TODO: Would this get call when we are in code of HTML?
799 } else { 801 } else {
diff --git a/js/mediators/io-mediator.js b/js/mediators/io-mediator.js
index 23668e13..097f5975 100644
--- a/js/mediators/io-mediator.js
+++ b/js/mediators/io-mediator.js
@@ -153,7 +153,7 @@ exports.IoMediator = Montage.create(Component, {
153 switch (file.mode) { 153 switch (file.mode) {
154 case 'html': 154 case 'html':
155 //Copy webGL library if needed 155 //Copy webGL library if needed
156 if (file.webgl.length > 0) { 156 if (file.webgl && file.webgl.length > 0) {
157 for (var i in this.application.ninja.coreIoApi.ninjaLibrary.libs) { 157 for (var i in this.application.ninja.coreIoApi.ninjaLibrary.libs) {
158 //Checking for RDGE library to be available 158 //Checking for RDGE library to be available
159 if (this.application.ninja.coreIoApi.ninjaLibrary.libs[i].name === 'RDGE') { 159 if (this.application.ninja.coreIoApi.ninjaLibrary.libs[i].name === 'RDGE') {
@@ -353,7 +353,7 @@ exports.IoMediator = Montage.create(Component, {
353 } 353 }
354 } 354 }
355 //Checking for webGL elements in document 355 //Checking for webGL elements in document
356 if (template.webgl.length) { 356 if (template.webgl && template.webgl.length) {
357 // 357 //
358 var json, matchingtags = [], webgltag, scripts = template.document.content.document.getElementsByTagName('script'); 358 var json, matchingtags = [], webgltag, scripts = template.document.content.document.getElementsByTagName('script');
359 // 359 //