From 7552771e69d50cf16ff74be9f3ea26d286ec3266 Mon Sep 17 00:00:00 2001 From: Christoph Wiechert Date: Tue, 28 Nov 2017 16:37:26 +0100 Subject: [PATCH] Fix: IE11 has no String.startsWith --- app/src/download.js | 7 +++++++ app/src/upload.js | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/app/src/download.js b/app/src/download.js index a794914..2fb8d0b 100644 --- a/app/src/download.js +++ b/app/src/download.js @@ -1,3 +1,10 @@ +if(!String.prototype.startsWith) { + String.prototype.startsWith = function(searchString, position) { + position = position || 0; + return this.indexOf(searchString, position) === position; + }; +} + import Vue from 'vue'; import Download from './Download.vue'; import Icon from 'vue-awesome/components/Icon.vue' diff --git a/app/src/upload.js b/app/src/upload.js index 4e00c67..4e28a77 100644 --- a/app/src/upload.js +++ b/app/src/upload.js @@ -1,3 +1,10 @@ +if(!String.prototype.startsWith) { + String.prototype.startsWith = function(searchString, position) { + position = position || 0; + return this.indexOf(searchString, position) === position; + }; +} + import Vue from 'vue'; import Upload from './Upload.vue'; import store from './Upload/store.js';