From 7f290bf996e6a91b1c5d2b5d74318f9c7a246d75 Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Fri, 18 Aug 2017 09:08:25 +0500 Subject: Optimize calendar load --- web/app/view/dialog/CalendarController.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'web/app/view/dialog') diff --git a/web/app/view/dialog/CalendarController.js b/web/app/view/dialog/CalendarController.js index 54dc7a3b..fb8cbff6 100644 --- a/web/app/view/dialog/CalendarController.js +++ b/web/app/view/dialog/CalendarController.js @@ -26,12 +26,12 @@ Ext.define('Traccar.view.dialog.CalendarController', { reader = new FileReader(); reader.onload = function (event) { fileField.up('window').lookupReference('dataField').setValue( - btoa(String.fromCharCode.apply(null, new Uint8Array(event.target.result)))); + event.target.result.substr(event.target.result.indexOf(',') + 1)); }; reader.onerror = function (event) { Traccar.app.showError(event.target.error); }; - reader.readAsArrayBuffer(fileField.fileInputEl.dom.files[0]); + reader.readAsDataURL(fileField.fileInputEl.dom.files[0]); } } }); -- cgit v1.2.3