1
0
Fork 0

WebPanel: use inkscape pagecolor as background-color if set

This commit is contained in:
Torsten Dreyer 2014-09-22 21:41:13 +02:00
parent e929b182af
commit 649ad4880c

View file

@ -71,6 +71,11 @@
var i = new FGFS.Instrument(data);
reply.push(i);
$(this).append(i.svg);
// set inkscape pagecolor as div background-color
// somewhat awkward get the namespaced sodipodi:namedview element
var pagecolor = $(i.svg.getElementsByTagNameNS('http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd', 'namedview')).attr("pagecolor");
if( pagecolor != null )
$(this).css("background-color", pagecolor );
},
error: function(xhr,status,msg) {
alert(status + " while reading '" + instrumentDefinitionFile + "': " + msg.toString() );