startsWith() function of java script is not supported in IE, instead use startsWith() function of underscore string. Fixes #2347

This commit is contained in:
Murtuza Zabuawala 2017-04-25 12:00:15 +05:30 committed by Akshay Joshi
parent f718e1f49c
commit 928c0d3de8
2 changed files with 7 additions and 4 deletions

View File

@ -14,7 +14,8 @@
// use alertify and underscore js
var alertify = require("alertify"),
_ = require("underscore");
_ = require("underscore"),
S = require("underscore.string");
/*---------------------------------------------------------
Define functions used for various operations
@ -173,7 +174,7 @@ var setUploader = function(path) {
$('.storage_dialog #uploader .input-path').val(path);
}
} else if (!config.options.platform_type === "win32" &&
(path == '' || !path.startsWith('/'))) {
(path == '' || !S.startsWith(path, '/'))) {
path = '/' + path;
$('.storage_dialog #uploader .input-path').val(path);
} else {
@ -1488,7 +1489,7 @@ function InputObject() {
path = path.replace(/\//g, '\\')
} else {
path = path.replace(/\\/g, '/')
if (!path.startsWith('/')) {
if (!S.startsWith(path, '/')) {
path = '/' + path;
}
}

View File

@ -3089,8 +3089,10 @@ define(
$("#btn-flash").prop('disabled', true);
if (explain_prefix != undefined && !sql.trim().toUpperCase().startsWith("EXPLAIN"))
if (explain_prefix != undefined &&
!S.startsWith(sql.trim().toUpperCase(), "EXPLAIN")) {
sql = explain_prefix + ' ' + sql;
}
self.query_start_time = new Date();
self.query = sql;