repo: janusweb action: commit revision: path_from: revision_from: a52acaafbef25b7efd2c347a90b7696e1439b8a0: path_to: revision_to:
commit a52acaafbef25b7efd2c347a90b7696e1439b8a0 Author: James BaicoianuDate: Sun Oct 31 01:42:24 2021 -0700 Don't set title or add event listeners if portal has no url diff --git a/scripts/portal.js b/scripts/portal.js
--- a/scripts/portal.js
+++ b/scripts/portal.js
@@ -53,7 +53,7 @@ elation.require(['janusweb.janusbase'], function() {
this.updateTitle = function() {
if (this.draw_text) {
var title = this.title;
- if (!title) {
+ if (!title && this.url) {
title = this.url.replace(/^https?:\/\//i, '');
if (title.match(/^[^\/]+\/$/)) {
title = title.substr(0, title.length - 1);
@@ -90,10 +90,12 @@ elation.require(['janusweb.janusbase'], function() {
this.createChildren = function() {
//elation.events.add(this.label, 'mouseover,mousemove,mouseout,click', this);
this.updateCollider();
- elation.events.add(this, 'click', elation.bind(this, this.activate));
- elation.events.add(this, 'mouseover', elation.bind(this, this.hover));
- elation.events.add(this, 'mouseout', elation.bind(this, this.unhover));
- elation.events.add(this, 'collide', (ev) => this.handleCollide());
+ if (this.url) {
+ elation.events.add(this, 'click', elation.bind(this, this.activate));
+ elation.events.add(this, 'mouseover', elation.bind(this, this.hover));
+ elation.events.add(this, 'mouseout', elation.bind(this, this.unhover));
+ elation.events.add(this, 'collide', (ev) => this.handleCollide());
+ }
}
this.createMaterial = function() {
var matargs = {
-----END OF PAGE-----