From 649ad4880c8b4852d159de3844dc13cae6d55b76 Mon Sep 17 00:00:00 2001 From: Torsten Dreyer Date: Mon, 22 Sep 2014 21:41:13 +0200 Subject: [PATCH] WebPanel: use inkscape pagecolor as background-color if set --- webgui/lib/jquery.fganimate.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/webgui/lib/jquery.fganimate.js b/webgui/lib/jquery.fganimate.js index 78c2d65f7..6b7e54f10 100644 --- a/webgui/lib/jquery.fganimate.js +++ b/webgui/lib/jquery.fganimate.js @@ -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() );