Sha256: 57846b1db3b75dd7753b89b780ff4fd721c5321d29349b4190993d8e8eefbdb1
Contents?: true
Size: 1.6 KB
Versions: 13
Compression:
Stored size: 1.6 KB
Contents
- entity_name = controller.controller_name.singularize.underscore #account - @entity = instance_variable_get("@#{entity_name}") - id = dom_id(@entity) - if params[:cancel].true? # <--------------------- Hide [Edit] - if called_from_landing_page? crm.flip_form('edit_#{entity_name}'); crm.set_title('edit_#{entity_name}', '#{h @entity.name}'); - else # Called from index page... $('##{id}').replaceWith('#{ j render(partial: entity_name, collection: [ @entity ]) }'); - 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) $('##{dom_id(@previous)}').replaceWith('#{ j render(partial: entity_name, collection: [ @previous ]) }'); - else crm.flick('#{entity_name}_#{@previous}', 'remove'); -# Disable onMouseOver for the list item. crm.highlight_off('#{id}'); -# Hide [Create] form if any. crm.hide_form('create_#{entity_name}'); -# Show [Edit] form. $('##{id}').html('#{ j render(partial: "edit") }'); - elsif params[:cancel].false? # Called from title of the contact landing page... $('#edit_#{entity_name}').html('#{ j render(partial: "edit") }'); crm.flip_form('edit_#{entity_name}'); crm.set_title('edit_#{entity_name}', "#{t :edit} #{h @entity.full_name}"); crm.create_or_select_account(#{ request.referer =~ /\/accounts\// || @account.id.blank? });
Version data entries
13 entries across 13 versions & 1 rubygems