elements
+ while (t.parentNode.parentNode.tagName === 'g') {
+ t = t.parentNode;
+ }
+ // if we are not in the middle of creating a path, and we've clicked on some shape,
+ // then go to Select mode.
+ // WebKit returns when the canvas is clicked, Firefox/Opera return