Skip to content

Commit

Permalink
fixes link_to_inline method and chosen selects
Browse files Browse the repository at this point in the history
  • Loading branch information
warp authored and steveyken committed Jan 9, 2014
1 parent db637f5 commit d51bed7
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions app/assets/javascripts/crm_chosen.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@

# Initialize chosen for multiselect tag list
crm.chosen_taglist = (asset, controller, id)->
new Chosen $('#' + asset + '_tag_list'), {
$('#' + asset + '_tag_list').chosen(
allow_option_creation: true
on_option_add: (tag) ->
crm.load_field_group(controller, tag, id)
on_option_remove: (tag) ->
crm.remove_field_group(tag)
}
)

crm.ensure_chosen_account = ->
unless $("#account_id_chzn")
new ajaxChosen $("#account_id"), {
$("#account_id").ajaxChosen(
allow_single_deselect: true
show_on_activate: true
url: "/accounts/auto_complete.json"
parameters: { limit: 25 }
query_key: "auto_complete_query"
}
)

# Prefer standard select2 dropdown for non-Ajaxy selectboxes
add_select2_boxes = ->
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def link_to_inline(id, url, options = {})
link_to(text,
url + "#{url.include?('?') ? '&' : '?'}cancel=false" + related,
:remote => true,
:onclick => "this.href = this.href.replace(/cancel=(true|false)/,'cancel='+ $('##{id}').css('display') != 'none');",
:onclick => "this.href = this.href.replace(/cancel=(true|false)/,'cancel='+ ($('##{id}').css('display') != 'none'));",
:class => options[:class]
)
end
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/groups/_form.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
%br
= f.select :user_ids, User.all.map {|u| [u.full_name, u.id]}, {}, :multiple => true
:javascript
new Chosen($('#group_user_ids'));
$('#group_user_ids').chosen();
2 changes: 1 addition & 1 deletion app/views/admin/users/_profile.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@
.label #{t :groups}:
= f.select :group_ids, Group.all.map {|g| [g.name, g.id]}, {}, :multiple => true
:javascript
new Chosen($('#user_group_ids'));
$('#user_group_ids').chosen();
4 changes: 2 additions & 2 deletions app/views/entities/_permissions.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@
%br
= f.select :user_ids, user_options, {}, :multiple => true
:javascript
new Chosen($('#{model}_user_ids'));
$('#{model}_user_ids').chosen();

%tr
%td
= f.label :group_ids, "#{t(:groups)}:"
%br
= f.select :group_ids, group_options, {}, :multiple => true
:javascript
new Chosen($('#{model}_group_ids'));
$('#{model}_group_ids').chosen();

- if !edit and entity.is_a?(Lead)
.radio_box
Expand Down
4 changes: 2 additions & 2 deletions app/views/leads/_convert_permissions.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@
%br
= select :lead, :user_ids, user_options, {}, :multiple => true
:javascript
new Chosen($('lead_user_ids'));
$('lead_user_ids').chosen();

%tr
%td
= label_tag :lead_group_ids, "#{t(:groups)}:"
%br
= select :lead, :group_ids, group_options, {}, :multiple => true
:javascript
new Chosen($('lead_group_ids'));
$('lead_group_ids').chosen();

0 comments on commit d51bed7

Please sign in to comment.