mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
svg.js: Fix menu on Firefox (Forum #49202)
git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@10799 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
2c3244e56a
commit
4527f0e43f
@ -79,6 +79,20 @@ sv_menu(evt, embed)
|
|||||||
var lines = $(svg).find("[line_id]");
|
var lines = $(svg).find("[line_id]");
|
||||||
var hidden = $(svg).find(".hidden");
|
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
|
function
|
||||||
showValOff() {
|
showValOff() {
|
||||||
$(svg).find("[id]").each(function(){delete($(this).get(0).showVal)});
|
$(svg).find("[id]").each(function(){delete($(this).get(0).showVal)});
|
||||||
@ -198,22 +212,8 @@ sv_menu(evt, embed)
|
|||||||
$("#content").append(par.div);
|
$("#content").append(par.div);
|
||||||
|
|
||||||
var pl = selNode[arrName];
|
var pl = selNode[arrName];
|
||||||
if(!pl) { // chrome 48+ removed the pathSegList interface
|
if(!pl)
|
||||||
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]) };
|
|
||||||
}
|
|
||||||
}
|
|
||||||
selNode[arrName] = pl = new myPathSegList(selNode);
|
selNode[arrName] = pl = new myPathSegList(selNode);
|
||||||
}
|
|
||||||
if(pl.numberOfItems > 2)
|
if(pl.numberOfItems > 2)
|
||||||
mousemove({pageX:pl.getItem(pl.numberOfItems-2).x});
|
mousemove({pageX:pl.getItem(pl.numberOfItems-2).x});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user