From b45ad8569475e6e5b15630484e91526729bbbb7d Mon Sep 17 00:00:00 2001 From: jgould Date: Fri, 29 Jul 2016 12:25:38 -0400 Subject: [PATCH] added create loading el function --- src/ui/heat_map.js | 4 ++-- src/util/util.js | 13 ++++++++++--- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/ui/heat_map.js b/src/ui/heat_map.js index a668de4..6ca69e3 100644 --- a/src/ui/heat_map.js +++ b/src/ui/heat_map.js @@ -199,7 +199,7 @@ morpheus.HeatMap = function (options) { symmetric: false, keyboard: true, inlineTooltip: true, - $loadingImage: $('
Loading...
'), + $loadingImage: morpheus.Util.createLoadingEl(), /** * Whether this heat map tab can be closed */ @@ -232,7 +232,7 @@ morpheus.HeatMap = function (options) { options.landingPage = new morpheus.LandingPage(); options.landingPage.$el.prependTo(this.$el); } - if (!this.options.name) { + if (this.options.name == null) { this.options.name = morpheus.Util .getBaseFileName(morpheus.Util .getFileName(this.options.dataset.file ? this.options.dataset.file diff --git a/src/util/util.js b/src/util/util.js index 5ad5f70..c81d786 100644 --- a/src/util/util.js +++ b/src/util/util.js @@ -207,7 +207,6 @@ morpheus.Util.getFileName = function (fileOrUrl) { return fileOrUrl.name; } var name = '' + fileOrUrl; - var question = name.indexOf('?'); if (question !== -1) { var params = name.substring(question + 1); @@ -223,9 +222,14 @@ morpheus.Util.getFileName = function (fileOrUrl) { } } else { var slash = name.lastIndexOf('/'); - if (slash !== -1 && slash < name.length - 1) { - // https://s3.amazonaws.com/data.clue.io/icv/dosval/BRD-K45711268_10_UM_24_H/pcl_cell.gct?AWSAccessKeyId=AKIAJZQISWLUKFS3VUKA&Expires=1455761050&Signature=HVle9MvXV3OGRZHOngdm2frqER8%3D + if (slash === name.length - 1) { + name = name.substring(0, name.length - 1); + slash = name.lastIndexOf('/'); + } + if (slash !== -1) { name = name.substring(slash + 1); // get stuff after slash + // https://s3.amazonaws.com/data.clue.io/icv/dosval/BRD-K45711268_10_UM_24_H/pcl_cell.gct?AWSAccessKeyId=AKIAJZQISWLUKFS3VUKA&Expires=1455761050&Signature=HVle9MvXV3OGRZHOngdm2frqER8%3D + } } return name; @@ -1297,6 +1301,9 @@ morpheus.Util.createValueToIndices = function (array, field) { return map; }; +morpheus.Util.createLoadingEl = function () { + return $('
Loading...
'); +}; /** * Splits a string by the new line character, trimming whitespace */ -- GitLab