repo: janusweb action: commit revision: path_from: revision_from: f38026733d00bf0eea09165f800969fc47223885: path_to: revision_to:
commit f38026733d00bf0eea09165f800969fc47223885 Author: James BaicoianuDate: Sat Oct 19 02:36:36 2019 -0700 Websurface image_id thumbnail support diff --git a/scripts/object.js b/scripts/object.js
--- a/scripts/object.js
+++ b/scripts/object.js
@@ -389,7 +389,7 @@ elation.require(['janusweb.janusbase', 'janusweb.websurface'], function() {
}
}
}
- if (this.websurface_id) {
+ if (this.websurface_id && this.websurface) {
this.replaceWebsurfaceMaterial();
return;
}
@@ -859,10 +859,13 @@ elation.require(['janusweb.janusbase', 'janusweb.websurface'], function() {
}
}
if (this.websurface_id) {
- if (!this.websurface) {
+ elation.events.add(this, 'click', elation.bind(this, this.handleWebsurfaceClick));
+ if (!this.websurface && !this.image_id) {
this.createWebsurface();
}
- this.websurface.start();
+ if (this.websurface) {
+ this.websurface.start();
+ }
}
}
this.stop = function() {
@@ -895,6 +898,11 @@ elation.require(['janusweb.janusbase', 'janusweb.websurface'], function() {
}
}
}
+ this.handleWebsurfaceClick = function() {
+ if (this.websurface_id && !this.websurface) {
+ this.createWebsurface();
+ }
+ }
this.handleAutoplayStart = function() {
if (this.playbutton) {
this.remove(this.playbutton);
-----END OF PAGE-----