repo: janusweb
action: commit
revision: 
path_from: 
revision_from: a52acaafbef25b7efd2c347a90b7696e1439b8a0:
path_to: 
revision_to: 
git.thebackupbox.net
janusweb
git clone git://git.thebackupbox.net/janusweb
commit a52acaafbef25b7efd2c347a90b7696e1439b8a0
Author: James Baicoianu 
Date:   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
index 27a1bb4392665d5a810bf3693873acc5c0a372ab..
index ..6bf957ff6fdf587603823d3b1bfc97c49850e1c2 100644
--- 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-----