Change icon when adding, fix #4568
This commit is contained in:
parent
3df0fdc09b
commit
bee2c63762
2 changed files with 16 additions and 8 deletions
|
|
@ -71,6 +71,9 @@ _.extend(app.tmp.ContactAspectsBox.prototype, {
|
|||
.addClass('added')
|
||||
.attr('data-membership_id', membership_id) // just to be sure...
|
||||
.data('membership_id', membership_id);
|
||||
|
||||
el.find('div').removeClass('icons-monotone_plus_add_round')
|
||||
.addClass('icons-monotone_check_yes');
|
||||
},
|
||||
|
||||
removeFromAspect: function(evt) {
|
||||
|
|
@ -97,6 +100,9 @@ _.extend(app.tmp.ContactAspectsBox.prototype, {
|
|||
.addClass('add')
|
||||
.removeAttr('data-membership_id')
|
||||
.removeData('membership_id');
|
||||
|
||||
el.find('div').removeClass('icons-monotone_check_yes')
|
||||
.addClass('icons-monotone_plus_add_round');
|
||||
},
|
||||
|
||||
_displayError: function(msg_id, contact_el) {
|
||||
|
|
|
|||
|
|
@ -41,16 +41,18 @@ module AspectsHelper
|
|||
end
|
||||
end
|
||||
|
||||
def aspect_visibility_link(aspect);
|
||||
def aspect_visibility_link(aspect)
|
||||
if aspect.contacts_visible?
|
||||
icon = 'icons-padlock-open';
|
||||
title = t('.aspect_list_is_visible');
|
||||
icon = 'icons-padlock-open'
|
||||
title = t('.aspect_list_is_visible')
|
||||
else
|
||||
icon = 'icons-padlock-closed';
|
||||
title = t('.aspect_list_is_not_visible');
|
||||
icon = 'icons-padlock-closed'
|
||||
title = t('.aspect_list_is_not_visible')
|
||||
end
|
||||
|
||||
link_to aspect_toggle_contact_visibility_path(@aspect), class: 'contact_visibility_link button', title: title, method: :put, remote: true do
|
||||
concat t('.visibility')
|
||||
concat content_tag(:div, nil, id: "contact_visibility_padlock", class: icon)
|
||||
end
|
||||
padlock = content_tag(:div, nil, id: "contact_visibility_padlock", class: icon);
|
||||
link_to "#{t('.visibility')} #{padlock}".html_safe, aspect_toggle_contact_visibility_path(@aspect),
|
||||
class: 'contact_visibility_link button', title: title, method: :put, remote: true;
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue