diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2016-11-15 20:57:52 +1300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-15 20:57:52 +1300 |
commit | 66ddfa07beda70c05cc2c51a6cb1979151c45cb8 (patch) | |
tree | 6e2d07bd1bd91724029c9c9f24edc70ec3cd2021 /web | |
parent | f44d7cb38903508bbeb59d916ac84a0cc50d530b (diff) | |
parent | 4f520750a2438e1d5229ef539024b4f3b57d9e32 (diff) | |
download | etbsa-traccar-web-66ddfa07beda70c05cc2c51a6cb1979151c45cb8.tar.gz etbsa-traccar-web-66ddfa07beda70c05cc2c51a6cb1979151c45cb8.tar.bz2 etbsa-traccar-web-66ddfa07beda70c05cc2c51a6cb1979151c45cb8.zip |
Merge pull request #318 from Abyss777/fix_kitkat
Workaround for kitkat
Diffstat (limited to 'web')
-rw-r--r-- | web/app/DeviceImages.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/web/app/DeviceImages.js b/web/app/DeviceImages.js index d976a2b..a05a815 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; |