diff options
author | Abyss777 <abyss@fox5.ru> | 2016-11-15 11:30:57 +0500 |
---|---|---|
committer | Abyss777 <abyss@fox5.ru> | 2016-11-15 11:30:57 +0500 |
commit | f5217473530909ff633952ae84b0e7a58fc453e2 (patch) | |
tree | d369f53c2251b6ac4caf02382d80e59303f65fd6 /web | |
parent | f44d7cb38903508bbeb59d916ac84a0cc50d530b (diff) | |
download | trackermap-web-f5217473530909ff633952ae84b0e7a58fc453e2.tar.gz trackermap-web-f5217473530909ff633952ae84b0e7a58fc453e2.tar.bz2 trackermap-web-f5217473530909ff633952ae84b0e7a58fc453e2.zip |
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 d976a2b3..502d412e 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 (document) { + var newDocument, newNode; + newDocument = document.implementation.createDocument(document.namespaceURI, null, null); + newNode = newDocument.importNode(document.documentElement, true); + newDocument.appendChild(newNode); + return newDocument; + }, + getImageIcon: function (color, zoom, angle, category) { var image, svg, width, height; |