Issue 40: Fix selection of groups
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@602 eee81c28-f429-11dd-99c0-75d572ba1ddd
This commit is contained in:
@@ -6,9 +6,8 @@ if(!window.console) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// this defines which elements and attributes that we support
|
// this defines which elements and attributes that we support
|
||||||
// TODO: add <g> elements to this
|
|
||||||
// TODO: add <a> elements to this
|
// TODO: add <a> elements to this
|
||||||
// TODO: add xmlns:xlink attr to <svg> element
|
// TODO: add <tspan> to this
|
||||||
var svgWhiteList = {
|
var svgWhiteList = {
|
||||||
"circle": ["cx", "cy", "fill", "fill-opacity", "id", "opacity", "r", "stroke", "stroke-dasharray", "stroke-opacity", "stroke-width", "transform"],
|
"circle": ["cx", "cy", "fill", "fill-opacity", "id", "opacity", "r", "stroke", "stroke-dasharray", "stroke-opacity", "stroke-width", "transform"],
|
||||||
"defs": [],
|
"defs": [],
|
||||||
@@ -1260,6 +1259,12 @@ function BatchCommand(text) {
|
|||||||
started = true;
|
started = true;
|
||||||
current_resize_mode = "none";
|
current_resize_mode = "none";
|
||||||
var t = evt.target;
|
var t = evt.target;
|
||||||
|
// if this element is in a group, go up until we reach the top-level group
|
||||||
|
while (t.parentNode.tagName == "g") {
|
||||||
|
t = t.parentNode;
|
||||||
|
}
|
||||||
|
// TODO: once we implement Layers, the top-level groups will be layers so
|
||||||
|
// we will want to stop just before then
|
||||||
// WebKit returns <div> when the canvas is clicked, Firefox/Opera return <svg>
|
// WebKit returns <div> when the canvas is clicked, Firefox/Opera return <svg>
|
||||||
var nodeName = t.nodeName.toLowerCase();
|
var nodeName = t.nodeName.toLowerCase();
|
||||||
if (nodeName != "div" && nodeName != "svg") {
|
if (nodeName != "div" && nodeName != "svg") {
|
||||||
|
|||||||
Reference in New Issue
Block a user