Sha256: abc18017dd5ea5003646c09b5b7942080cf959bc775d3e05c3d7d4a11fe2fbf8

Contents?: true

Size: 1.57 KB

Versions: 5

Compression:

Stored size: 1.57 KB

Contents

id = dom_id(@contact)

if params[:cancel].true?     # <----------------- Hide [Edit Contact]

  if called_from_landing_page?
    page.call "crm.flip_form", :edit_contact
    page.call "crm.set_title", :edit_contact, h(@contact.full_name)
  else                                            # Called from contacts list item...
    page[id].replace :partial => "contact", :collection => [ @contact ]
  end

else # <----------------------------------------- Show [Edit Contact] form.

  if params[:cancel].blank?                       # Called from contacts list item...
    if @previous                                  # Hide open [Edit Contact] form if any.
      if @previous.is_a?(Contact)
        page[dom_id(@previous)].replace :partial => "contact", :collection => [ @previous ]
      else
        page.call "crm.flick", "contact_#{@previous}", :remove
      end
    end
    page.call "crm.highlight_off", id             # Disable onMouseOver for the list item.
    page.call "crm.hide_form", :create_contact    # Hide [Create Contact] form if any.
    page[id].replace_html :partial => "edit"      # Show [Edit Contact] form.

  elsif params[:cancel].false?                    # Called from title of the contact landing page...
    page[:edit_contact].replace_html :partial => "edit"
    page.call "crm.flip_form", :edit_contact
    page.call "crm.set_title", :edit_contact, "#{t :edit} #{h(@contact.full_name)}"
  end

  page.call "crm.create_or_select_account", request.referer =~ /\/accounts\// || @account.id.blank?
  page[:contact_first_name].focus

  hook(:edit_contact_rjs, self, :page => page)
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
fat_free_crm-0.12.3 app/views/contacts/edit.js.rjs
fat_free_crm-0.12.2 app/views/contacts/edit.js.rjs
fat_free_crm-0.12.1 app/views/contacts/edit.js.rjs
fat_free_crm-0.12.0 app/views/contacts/edit.js.rjs
fat_free_crm-0.11.4 app/views/contacts/edit.js.rjs