src/pyams_skin/resources/js/myams.js
changeset 421 4d702bb76f83
parent 415 2a3d2406b270
child 424 5992a50ecb29
--- a/src/pyams_skin/resources/js/myams.js	Thu Sep 27 12:08:38 2018 +0200
+++ b/src/pyams_skin/resources/js/myams.js	Tue Oct 02 12:20:24 2018 +0200
@@ -3073,10 +3073,14 @@
 				if (svgs.length > 0) {
 					svgs.each(function() {
 						var container = $(this);
-						var svg = $('svg', container);
-						svg.get(0).setAttribute('viewBox',
-												'0 0 ' + Math.round(parseFloat(svg.attr('width'))) + ' ' +
-														 Math.round(parseFloat(svg.attr('height'))));
+						var svg = $('svg', container),
+							width = svg.attr('width'),
+							height = svg.attr('height');
+						if (width && height) {
+							svg.get(0).setAttribute('viewBox',
+													'0 0 ' + Math.round(parseFloat(width)) + ' ' +
+															 Math.round(parseFloat(height)));
+						}
 						svg.attr('width', '100%')
 						   .attr('height', 'auto');
 					})