mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-03 19:45:44 -05:00
Simplify fix proposed in #164.
This commit is contained in:
parent
88a33200c2
commit
ee03ce47e4
1 changed files with 2 additions and 3 deletions
|
@ -531,9 +531,8 @@ var View = this.View = Base.extend(Callback, /** @lends View# */{
|
||||||
function getView(event) {
|
function getView(event) {
|
||||||
// Get the view from the current event target.
|
// Get the view from the current event target.
|
||||||
var target = DomEvent.getTarget(event);
|
var target = DomEvent.getTarget(event);
|
||||||
if (target.getAttribute === undefined)
|
// Some node do not have the getAttribute method, e.g. SVG nodes.
|
||||||
return false;
|
return target.getAttribute && View._viewsById[target.getAttribute('id')];
|
||||||
return View._viewsById[DomEvent.getTarget(event).getAttribute('id')];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function viewToProject(view, event) {
|
function viewToProject(view, event) {
|
||||||
|
|
Loading…
Reference in a new issue