From eab04a7b18add146e016e237d0c113638547906e Mon Sep 17 00:00:00 2001 From: Greg Dean Date: Mon, 26 Aug 2019 14:54:51 -0400 Subject: [PATCH 1/2] adding check to make sure Help Tips exist before making a help tour for a portlet --- html/gui/js/Portlet.js | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/html/gui/js/Portlet.js b/html/gui/js/Portlet.js index 629a26e617..bf2b7e1245 100644 --- a/html/gui/js/Portlet.js +++ b/html/gui/js/Portlet.js @@ -36,27 +36,29 @@ CCR.xdmod.ui.Portlet = Ext.extend(Ext.ux.Portlet, { helpTour: null, helpTourDetails: [], initComponent: function () { - this.helpTourDetails.tips.forEach(function (value, index, arr) { - arr[index].target = (value.target.slice(0, 1) !== '/') ? '#' + this.id + ' ' + value.target : value.target.slice(1, value.target.length); - }, this); + if (this.helpTourDetails.tips !== undefined && this.helpTourDetails.tips.length > 0) { + this.helpTourDetails.tips.forEach(function (value, index, arr) { + arr[index].target = (value.target.slice(0, 1) !== '/') ? '#' + this.id + ' ' + value.target : value.target.slice(1, value.target.length); + }, this); - this.helpTour = new Ext.ux.HelpTipTour({ - title: this.helpTourDetails.title, - items: this.helpTourDetails.tips - }); + this.helpTour = new Ext.ux.HelpTipTour({ + title: this.helpTourDetails.title, + items: this.helpTourDetails.tips + }); - if (this.tools === undefined) { - this.tools = []; - } - - this.tools.push({ - id: 'maximize', - qtip: 'View Portlet Help Tour', - scope: this, - handler: function (event, toolEl, panel) { - this.helpTour.startTour(); + if (this.tools === undefined) { + this.tools = []; } - }); + + this.tools.push({ + id: 'maximize', + qtip: 'View Portlet Help Tour', + scope: this, + handler: function (event, toolEl, panel) { + this.helpTour.startTour(); + } + }); + } Ext.ux.Portlet.superclass.initComponent.apply(this, arguments); } From 4b046e98a64ba028716b3d2c9fadd221df2f60e7 Mon Sep 17 00:00:00 2001 From: Greg Dean Date: Tue, 27 Aug 2019 10:59:19 -0400 Subject: [PATCH 2/2] initialize helpTourDetails as an object --- html/gui/js/Portlet.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/html/gui/js/Portlet.js b/html/gui/js/Portlet.js index bf2b7e1245..d324825577 100644 --- a/html/gui/js/Portlet.js +++ b/html/gui/js/Portlet.js @@ -34,7 +34,7 @@ */ CCR.xdmod.ui.Portlet = Ext.extend(Ext.ux.Portlet, { helpTour: null, - helpTourDetails: [], + helpTourDetails: {}, initComponent: function () { if (this.helpTourDetails.tips !== undefined && this.helpTourDetails.tips.length > 0) { this.helpTourDetails.tips.forEach(function (value, index, arr) {