Potential fix by calling the update every 5 seconds. Brute force but works.

When the FireFox "suggest history" dropbox is used, neither the blur nor change event is fired.  I have one solution that covers many of the common cases but fails on some others:

* Works - type, down arrow to suggest history, tab
* Works - type, down arrow to suggest history, enter, tab
* Works - type, click
* Works - type, tab
* Fails - down arrow to suggest history, enter, tab
* Fails - down arrow to suggest history, arrow right, tab

I have another solution which is to have a timer update the budget every 5 seconds.  This will make sure that even if the blur/change events are not fired, the values will be updated soon.  It's brute force but works (in FF so far, still need to test cross-browser).  I'm not seeing any performance impact, even with debugging on.

  #1350
This commit is contained in:
Eric Davis committed 2008-06-19 16:33:15 -07:00
1 parent b776098c7d
commit 8295b737a1
2 files changed
+11 -6

No files matched your search

+2 -1
View File
@@ -2,6 +2,7 @@ module DeliverablesHelper
# Helper to generate a form used to calculate the total budget while editing
# a Deliverable
# TODO Later: Refactor since observers are not used anymore
def field_with_budget_observer_and_totals(form, field)
content_tag(:tr,
content_tag(:td, "<label for='deliverable_#{field.to_s}'>#{l_field(field, 'field_')}</label>") +
@@ -11,7 +12,7 @@ module DeliverablesHelper
0,
:class => "budget-calculation",
:id => field.to_s + '_subtotal'
) + observe_field('deliverable_' + field.to_s, :function => "new Budget.updateAmounts();"),
),
:class => "calculation-column"
))