Permalink
Browse files

Fix the Event.findElement prototype function. Needed to get autocompl…

…ete working with Safari #1528 [Thomas Fuchs]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1547 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 938a8fe commit d763f08ba81f0e3e4aac9c09f0342a2a53254211 @dhh dhh committed Jun 28, 2005
Showing with 3 additions and 3 deletions.
  1. +3 −3 actionpack/lib/action_view/helpers/javascripts/prototype.js
View
6 actionpack/lib/action_view/helpers/javascripts/prototype.js
@@ -797,9 +797,9 @@ Object.extend(Event, {
// find the first node with the given tagName, starting from the
// node the event was triggered on; traverses the DOM upwards
findElement: function(event, tagName) {
- element = Event.element(event);
- while (element.tagName.toUpperCase() != tagName.toUpperCase()
- && element.parentNode)
+ var element = Event.element(event);
+ while (element.parentNode && (!element.tagName ||
+ (element.tagName.toUpperCase() != tagName.toUpperCase())))
element = element.parentNode;
return element;
},

0 comments on commit d763f08

Please sign in to comment.