aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-08-18 16:57:45 +1200
committerGitHub <noreply@github.com>2017-08-18 16:57:45 +1200
commitb3d3c720f34e12e7af83e6be3bd87e304931bbe1 (patch)
treee33b456ca2adaf0f7c07e03355efb9a2ceb8f1fb
parentd2f7d47dfad47edd5bf604c76a20a130aa1cfee3 (diff)
parent0ba681d5b99ec0145d621f2e2d24553f3ae3439b (diff)
downloadtrackermap-web-b3d3c720f34e12e7af83e6be3bd87e304931bbe1.tar.gz
trackermap-web-b3d3c720f34e12e7af83e6be3bd87e304931bbe1.tar.bz2
trackermap-web-b3d3c720f34e12e7af83e6be3bd87e304931bbe1.zip
Merge pull request #555 from Abyss777/calendar_upload
Optimize calendar load
-rw-r--r--package.json3
-rw-r--r--web/app/view/dialog/CalendarController.js4
2 files changed, 3 insertions, 4 deletions
diff --git a/package.json b/package.json
index d313631a..4862acfb 100644
--- a/package.json
+++ b/package.json
@@ -17,8 +17,7 @@
"Traccar": false,
"Strings": false,
"Locale": false,
- "proj4": false,
- "Uint8Array": false
+ "proj4": false
},
"rules": {
"strict": "off",
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]);
}
}
});