Commit b45ad856 authored by jgould's avatar jgould

added create loading el function

parent e41e39b7
...@@ -199,7 +199,7 @@ morpheus.HeatMap = function (options) { ...@@ -199,7 +199,7 @@ morpheus.HeatMap = function (options) {
symmetric: false, symmetric: false,
keyboard: true, keyboard: true,
inlineTooltip: true, inlineTooltip: true,
$loadingImage: $('<div style="overflow:hidden;text-align:center;"><i class="fa fa-spinner fa-spin fa-3x"></i><span style="padding-left:4px;vertical-align:middle;font-weight:bold;">Loading...</span></div>'), $loadingImage: morpheus.Util.createLoadingEl(),
/** /**
* Whether this heat map tab can be closed * Whether this heat map tab can be closed
*/ */
...@@ -232,7 +232,7 @@ morpheus.HeatMap = function (options) { ...@@ -232,7 +232,7 @@ morpheus.HeatMap = function (options) {
options.landingPage = new morpheus.LandingPage(); options.landingPage = new morpheus.LandingPage();
options.landingPage.$el.prependTo(this.$el); options.landingPage.$el.prependTo(this.$el);
} }
if (!this.options.name) { if (this.options.name == null) {
this.options.name = morpheus.Util this.options.name = morpheus.Util
.getBaseFileName(morpheus.Util .getBaseFileName(morpheus.Util
.getFileName(this.options.dataset.file ? this.options.dataset.file .getFileName(this.options.dataset.file ? this.options.dataset.file
......
...@@ -207,7 +207,6 @@ morpheus.Util.getFileName = function (fileOrUrl) { ...@@ -207,7 +207,6 @@ morpheus.Util.getFileName = function (fileOrUrl) {
return fileOrUrl.name; return fileOrUrl.name;
} }
var name = '' + fileOrUrl; var name = '' + fileOrUrl;
var question = name.indexOf('?'); var question = name.indexOf('?');
if (question !== -1) { if (question !== -1) {
var params = name.substring(question + 1); var params = name.substring(question + 1);
...@@ -223,9 +222,14 @@ morpheus.Util.getFileName = function (fileOrUrl) { ...@@ -223,9 +222,14 @@ morpheus.Util.getFileName = function (fileOrUrl) {
} }
} else { } else {
var slash = name.lastIndexOf('/'); var slash = name.lastIndexOf('/');
if (slash !== -1 && slash < name.length - 1) { if (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 name = name.substring(0, name.length - 1);
slash = name.lastIndexOf('/');
}
if (slash !== -1) {
name = name.substring(slash + 1); // get stuff after slash 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; return name;
...@@ -1297,6 +1301,9 @@ morpheus.Util.createValueToIndices = function (array, field) { ...@@ -1297,6 +1301,9 @@ morpheus.Util.createValueToIndices = function (array, field) {
return map; return map;
}; };
morpheus.Util.createLoadingEl = function () {
return $('<div style="overflow:hidden;text-align:center;"><i class="fa fa-spinner fa-spin fa-3x"></i><span style="padding-left:4px;vertical-align:middle;font-weight:bold;">Loading...</span></div>');
};
/** /**
* Splits a string by the new line character, trimming whitespace * Splits a string by the new line character, trimming whitespace
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment