diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-06-28 09:47:56 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-06-28 09:47:56 +0000 |
commit | d763f08ba81f0e3e4aac9c09f0342a2a53254211 (patch) | |
tree | be13e84c87f057bc2bd238a56ecaed7837971532 | |
parent | 938a8fea27a5271403edc6a3e6ab76dda15d9a5b (diff) | |
download | rails-d763f08ba81f0e3e4aac9c09f0342a2a53254211.tar.gz rails-d763f08ba81f0e3e4aac9c09f0342a2a53254211.tar.bz2 rails-d763f08ba81f0e3e4aac9c09f0342a2a53254211.zip |
Fix the Event.findElement prototype function. Needed to get autocomplete working with Safari #1528 [Thomas Fuchs]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1547 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-rw-r--r-- | actionpack/lib/action_view/helpers/javascripts/prototype.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/actionpack/lib/action_view/helpers/javascripts/prototype.js b/actionpack/lib/action_view/helpers/javascripts/prototype.js index bba61b91a0..02d103498e 100644 --- a/actionpack/lib/action_view/helpers/javascripts/prototype.js +++ b/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; }, |