Skip to content

Commit

Permalink
Improve mailing recipient selection in modal
Browse files Browse the repository at this point in the history
Make UX consistant with member selection in groups
  • Loading branch information
gagnieray authored and trasher committed Nov 22, 2023
1 parent 29db5c9 commit b06d76a
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions galette/templates/default/pages/mailing_form.html.twig
Expand Up @@ -363,13 +363,14 @@
$('#selected_members ul').append(_none);
}
});
$('.members-selection a.choice').click(function(e){
e.preventDefault();
var _mid = this.href.match(/.*\/(\d+)$/)[1];
var _mname = $(this).text();
$('#listing tbody tr').click(function(event){
event.preventDefault();
var _mlink = $(this).find('.username_row a');
var _mid = _mlink[0].href.match(/.*\/(\d+)$/)[1];
var _mname = _mlink.text();
$('#none_selected').remove()
if ( $('#member_' + _mid).length == 0 ) {
var _li = '<li id="member_' + _mid + '" class="item"><i class="user minus icon" aria-hidden="true"></i><span class="ui content">' + _mname + '</span></li>';
var _li = '<li id="member_' + _mid + '" class="item"><i class="ui user minus icon" aria-hidden="true"></i><span class="ui content">' + _mname + '</span></li>';
$('#selected_members ul').append(_li);
$('#member_' + _mid).click(function(){
$(this).remove();
Expand All @@ -379,7 +380,7 @@
});
}
return false;
});
}).css('cursor', 'pointer').attr('title', '{{ _T("Click on a row to select a member")|e('js') }}');
$('.members-selection .pagination a').click(function(){
var _members = new Array();
Expand Down

0 comments on commit b06d76a

Please sign in to comment.