From ee03ce47e48673db914e2e18fec19045eeb4dfaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Thu, 14 Feb 2013 12:41:50 -0800 Subject: [PATCH] Simplify fix proposed in #164. --- src/ui/View.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/ui/View.js b/src/ui/View.js index b540b739..bdf4c9d1 100644 --- a/src/ui/View.js +++ b/src/ui/View.js @@ -531,9 +531,8 @@ var View = this.View = Base.extend(Callback, /** @lends View# */{ function getView(event) { // Get the view from the current event target. var target = DomEvent.getTarget(event); - if (target.getAttribute === undefined) - return false; - return View._viewsById[DomEvent.getTarget(event).getAttribute('id')]; + // Some node do not have the getAttribute method, e.g. SVG nodes. + return target.getAttribute && View._viewsById[target.getAttribute('id')]; } function viewToProject(view, event) {