mirror of
https://github.com/documize/community.git
synced 2025-07-22 06:39:43 +02:00
Cross-browser support for JS strings startWith
This commit is contained in:
parent
d5be8ec843
commit
a0f6626367
3 changed files with 5 additions and 6 deletions
|
@ -147,15 +147,15 @@ export default Component.extend(Notifier, {
|
||||||
let tag3 = this.get("tag3").toLowerCase().trim();
|
let tag3 = this.get("tag3").toLowerCase().trim();
|
||||||
let save = "#";
|
let save = "#";
|
||||||
|
|
||||||
if (tag1.startsWith('-')) {
|
if (is.startWith(tag1, '-')) {
|
||||||
$('#add-tag-field1').addClass('is-invalid');
|
$('#add-tag-field1').addClass('is-invalid');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (tag2.startsWith('-')) {
|
if (is.startWith(tag2, '-')) {
|
||||||
$('#add-tag-field2').addClass('is-invalid');
|
$('#add-tag-field2').addClass('is-invalid');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (tag3.startsWith('-')) {
|
if (is.startWith(tag3, '-')) {
|
||||||
$('#add-tag-field3').addClass('is-invalid');
|
$('#add-tag-field3').addClass('is-invalid');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,7 +39,7 @@ export default AjaxService.extend({
|
||||||
let appVersion = headers['x-documize-version'];
|
let appVersion = headers['x-documize-version'];
|
||||||
|
|
||||||
// when unauthorized on local API AJAX calls, redirect to app root
|
// when unauthorized on local API AJAX calls, redirect to app root
|
||||||
if (status === 401 && is.not.undefined(appVersion) && is.not.includes(window.location.href, '/auth')) {
|
if (status === 401 && is.not.undefined(appVersion) && is.not.include(window.location.href, '/auth')) {
|
||||||
this.get('localStorage').clearAll();
|
this.get('localStorage').clearAll();
|
||||||
window.location.href = 'auth/login';
|
window.location.href = 'auth/login';
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,6 @@
|
||||||
/* jshint node: true */
|
/* jshint node: true */
|
||||||
|
|
||||||
module.exports = function (environment) {
|
module.exports = function (environment) {
|
||||||
|
|
||||||
var ENV = {
|
var ENV = {
|
||||||
modulePrefix: 'documize',
|
modulePrefix: 'documize',
|
||||||
podModulePrefix: 'documize/pods',
|
podModulePrefix: 'documize/pods',
|
||||||
|
@ -94,7 +93,7 @@ module.exports = function (environment) {
|
||||||
|
|
||||||
process.argv.forEach(function (element) {
|
process.argv.forEach(function (element) {
|
||||||
if (element !== undefined) {
|
if (element !== undefined) {
|
||||||
if (element.startsWith("apiHost=")) {
|
if (element.indexOf('apiHost=') === 0) {
|
||||||
element = element.replace("apiHost=", "");
|
element = element.replace("apiHost=", "");
|
||||||
ENV.apiHost = element;
|
ENV.apiHost = element;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue