aboutsummaryrefslogtreecommitdiff
path: root/web/app
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-11-15 20:57:52 +1300
committerGitHub <noreply@github.com>2016-11-15 20:57:52 +1300
commit66ddfa07beda70c05cc2c51a6cb1979151c45cb8 (patch)
tree6e2d07bd1bd91724029c9c9f24edc70ec3cd2021 /web/app
parentf44d7cb38903508bbeb59d916ac84a0cc50d530b (diff)
parent4f520750a2438e1d5229ef539024b4f3b57d9e32 (diff)
downloadtrackermap-web-66ddfa07beda70c05cc2c51a6cb1979151c45cb8.tar.gz
trackermap-web-66ddfa07beda70c05cc2c51a6cb1979151c45cb8.tar.bz2
trackermap-web-66ddfa07beda70c05cc2c51a6cb1979151c45cb8.zip
Merge pull request #318 from Abyss777/fix_kitkat
Workaround for kitkat
Diffstat (limited to 'web/app')
-rw-r--r--web/app/DeviceImages.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/web/app/DeviceImages.js b/web/app/DeviceImages.js
index d976a2b3..a05a8153 100644
--- a/web/app/DeviceImages.js
+++ b/web/app/DeviceImages.js
@@ -24,6 +24,9 @@ Ext.define('Traccar.DeviceImages', {
info = Ext.getStore('DeviceImages').findRecord('key', category || 'default', 0, false, false, true);
svg = Ext.clone(info.get('svg'));
+ if (!svg) {
+ svg = this.cloneDocument(info.get('svg'));
+ }
width = parseFloat(svg.documentElement.getAttribute('width'));
height = parseFloat(svg.documentElement.getAttribute('height'));
@@ -67,6 +70,14 @@ Ext.define('Traccar.DeviceImages', {
encodeURIComponent(new XMLSerializer().serializeToString(svg.documentElement));
},
+ cloneDocument: function (svgDocument) {
+ var newDocument, newNode;
+ newDocument = svgDocument.implementation.createDocument(svgDocument.namespaceURI, null, null);
+ newNode = newDocument.importNode(svgDocument.documentElement, true);
+ newDocument.appendChild(newNode);
+ return newDocument;
+ },
+
getImageIcon: function (color, zoom, angle, category) {
var image, svg, width, height;