diff options
author | Jamis Buck <jamis@37signals.com> | 2005-09-02 14:06:17 +0000 |
---|---|---|
committer | Jamis Buck <jamis@37signals.com> | 2005-09-02 14:06:17 +0000 |
commit | fd9c15e420a8b7219126962ecb44a19542335122 (patch) | |
tree | ed0f1e4549f8750b62cdce44f038f9f10a52a53f /actionpack/lib/action_view | |
parent | 97adfdaa6597953a4c4f501ce340c27caf85c069 (diff) | |
download | rails-fd9c15e420a8b7219126962ecb44a19542335122.tar.gz rails-fd9c15e420a8b7219126962ecb44a19542335122.tar.bz2 rails-fd9c15e420a8b7219126962ecb44a19542335122.zip |
Fix observe_field to fall back to event-based observation if frequency <= 0 #1916 [michael@schubert.cx]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2104 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_view')
-rw-r--r-- | actionpack/lib/action_view/helpers/javascript_helper.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/actionpack/lib/action_view/helpers/javascript_helper.rb b/actionpack/lib/action_view/helpers/javascript_helper.rb index 2bd741bd79..e6985c5eb7 100644 --- a/actionpack/lib/action_view/helpers/javascript_helper.rb +++ b/actionpack/lib/action_view/helpers/javascript_helper.rb @@ -305,9 +305,10 @@ module ActionView # # Additional options are: # <tt>:frequency</tt>:: The frequency (in seconds) at which changes to - # this field will be detected. Set this to a value - # greater than zero to use time based observation - # instead of event based observation. + # this field will be detected. Not setting this + # option at all or to a value equal to or less than + # zero will use event based observation instead of + # time based observation. # <tt>:update</tt>:: Specifies the DOM ID of the element whose # innerHTML should be updated with the # XMLHttpRequest response text. @@ -319,7 +320,7 @@ module ActionView # Additionally, you may specify any of the options documented in # +link_to_remote. def observe_field(field_id, options = {}) - if options[:frequency] + if options[:frequency] and options[:frequency] > 0 build_observer('Form.Element.Observer', field_id, options) else build_observer('Form.Element.EventObserver', field_id, options) |