Skip to content

Commit cb303ac

Browse files
authored
Fix minor issues (#294)
* Fix issue in IE11 Template literals is not supported in IE * Fix issue due to data model change * Add endsWith polyfill for IE11
1 parent c5eb1ba commit cb303ac

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

app/scripts/app.js

+9
Original file line numberDiff line numberDiff line change
@@ -392,3 +392,12 @@ jQuery.extend(jQuery.fn.dataTableExt.oSort, {
392392
return _b - _a;
393393
}
394394
});
395+
396+
if (!String.prototype.endsWith) {
397+
String.prototype.endsWith = function(search, this_len) {
398+
if (this_len === undefined || this_len > this.length) {
399+
this_len = this.length;
400+
}
401+
return this.substring(this_len - search.length, this_len) === search;
402+
};
403+
}

app/scripts/controllers/actionalGenes.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ angular.module('oncokbStaticApp')
129129
};
130130

131131
$scope.getFilteredResultStatement = function() {
132-
return $sce.trustAsHtml(`<span style="font-weight: bold;">Showing ${$scope.filterResults.treatments.length} biomarker-drug ${pluralize('association', $scope.filterResults.treatments.length)}</span> (${$scope.filterResults.genes.total.length} ${pluralize('gene', $scope.filterResults.genes.total.length)}, ${$scope.filterResults.tumorTypes.length} ${pluralize('tumor type', $scope.filterResults.tumorTypes.length)}, ${$scope.filterResults.levels.length} ${pluralize('level', $scope.filterResults.levels.length)} of evidence)`);
132+
return $sce.trustAsHtml('<span style="font-weight: bold;">Showing ' + $scope.filterResults.treatments.length + ' biomarker-drug ' + pluralize('association', $scope.filterResults.treatments.length) + '</span> ('+$scope.filterResults.genes.total.length+' ' + pluralize('gene', $scope.filterResults.genes.total.length) + ', '+$scope.filterResults.tumorTypes.length+' '+pluralize('tumor type', $scope.filterResults.tumorTypes.length)+', ' + $scope.filterResults.levels.length+' '+ pluralize('level', $scope.filterResults.levels.length) +' of evidence)');
133133
};
134134

135135
$scope.pluralizeString = function(string, number) {
@@ -176,11 +176,11 @@ angular.module('oncokbStaticApp')
176176
api.getAllMainTypes()
177177
.then(function(response) {
178178
$scope.tumorTypes = _.uniqBy($scope.tumorTypes.concat(response.data.filter(function(record) {
179-
return !record.trim().endsWith("NOS");
179+
return !record.name.trim().endsWith("NOS");
180180
}).map(function(mainType) {
181181
return {
182182
type: 'Main Type',
183-
name: mainType
183+
name: mainType.name
184184
};
185185
})), 'name');
186186
deferred.resolve();

app/scripts/directives/main-level.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ angular.module('oncokbStaticApp')
2828
open: false
2929
};
3030
scope.getContent = function() {
31-
return `${scope.geneCount} ${pluralize('Gene', scope.geneCount)}`;
31+
return scope.geneCount + ' ' + pluralize('Gene', scope.geneCount);
3232
};
3333
}
3434
};

0 commit comments

Comments
 (0)