From 6afa85c397a279afd2103a68f032a2b8d72f8b01 Mon Sep 17 00:00:00 2001 From: rudolfkoenig <> Date: Fri, 12 Feb 2016 15:44:13 +0000 Subject: [PATCH] svg.js: Fix menu on Firefox (Forum #49202) git-svn-id: https://svn.fhem.de/fhem/trunk@10799 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/www/pgm2/svg.js | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/fhem/www/pgm2/svg.js b/fhem/www/pgm2/svg.js index d7aee6d6e..5cbe871d7 100644 --- a/fhem/www/pgm2/svg.js +++ b/fhem/www/pgm2/svg.js @@ -79,6 +79,20 @@ sv_menu(evt, embed) var lines = $(svg).find("[line_id]"); var hidden = $(svg).find(".hidden"); + function + myPathSegList(node) // chrome 48+ removed the pathSegList interface + { + this.arr = $(node).attr("d").split(/ */); + this.arr.splice(0,1); // remove M + this.arr.splice(1,1); // remove L/Q/etc + this.numberOfItems = this.arr.length; + this.getItem = function(pos) + { + var xy = this.arr[pos].split(","); + return { x:parseFloat(xy[0]), y:parseFloat(xy[1]) }; + } + } + function showValOff() { $(svg).find("[id]").each(function(){delete($(this).get(0).showVal)}); @@ -198,22 +212,8 @@ sv_menu(evt, embed) $("#content").append(par.div); var pl = selNode[arrName]; - if(!pl) { // chrome 48+ removed the pathSegList interface - function - myPathSegList(node) - { - this.arr = $(node).attr("d").split(/ */); - this.arr.splice(0,1); // remove M - this.arr.splice(1,1); // remove L/Q/etc - this.numberOfItems = this.arr.length; - this.getItem = function(pos) - { - var xy = this.arr[pos].split(","); - return { x:parseFloat(xy[0]), y:parseFloat(xy[1]) }; - } - } + if(!pl) selNode[arrName] = pl = new myPathSegList(selNode); - } if(pl.numberOfItems > 2) mousemove({pageX:pl.getItem(pl.numberOfItems-2).x}); }