Sha256: 542d78f65f1ee330221e202491e29c7654f8a55add0d343fd326e793196e1932

Contents?: true

Size: 1.4 KB

Versions: 2

Compression:

Stored size: 1.4 KB

Contents

# NOTE: We overide this templayte b/c it seems as if there's a bug in active scaffold
# that causes nested forms to always stay open after submit. We didn't want that, so
# this version is only slightly different than the dist
page.insert_html :top, active_scaffold_tbody_id, :partial => 'list_record', :locals => {:record => @record}
page.replace active_scaffold_calculations_id, :partial => 'list_calculations' if active_scaffold_config.list.columns.any? {|c| c.calculation?}
page << "ActiveScaffold.stripe($('#{active_scaffold_tbody_id}'))"
page << "ActiveScaffold.hide_empty_message('#{active_scaffold_tbody_id}','#{empty_message_id}');"
page << "ActiveScaffold.increment_record_count('#{active_scaffold_id}');"
logger.error "HMM : #{element_form_id(:action => :new_existing)}"
# Modified
form_stays_open = nil
if (form_stays_open)
# /Modified
  # why not just re-render the form? that wouldn't utilize a possible do_new override which sets default values.
  page << "$('#{element_form_id}').reset()"
  page.replace_html element_messages_id(:action => :add_existing), :partial => 'form_messages'
  # have to delay the focus, because there's no "firstElement" in prototype until at least one element is not disabled
  page.delay 0.1 do
    page << "Form.focusFirstElement('#{element_form_id}');"
  end
else
  # Modified
  page << "$$('##{element_form_id(:action => :add_existing)} a.cancel').first().link.close();"
  # /Modified
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
brisk-bills-0.8.2 app/views/active_scaffold_overrides/add_existing.js.rjs
brisk-bills-0.8.1 app/views/active_scaffold_overrides/add_existing.js.rjs