|
9 | 9 | _cloned.prop('id', 'comment_' + _num); |
10 | 10 | _cloned.find('.input_comment_num').val(_num); |
11 | 11 | _cloned.find('.input_response_type').prop('disabled', false).attr('name', 'response_' + _num); |
| 12 | + _cloned.find('.note_recipients').prop('disabled', false).attr('name', 'comment_' + _num + '_note_recipients[]'); |
| 13 | + _cloned.find('.reply_recipients').attr('name', 'comment_' + _num + '_reply_recipients[]'); |
| 14 | +
|
12 | 15 | _cloned.find('.input_comment_text').prop('disabled', false).attr('name', 'comment_' + _num); |
| 16 | +
|
13 | 17 | _cloned.find('.input_comment_notification_text').prop('disabled', false).attr('name', 'comment_' + _num + '_notification_text'); |
14 | 18 | if ($('input[name=hidden]:checked').val() == 'true'){ |
15 | 19 | _cloned.find('.switch_response_type').hide(); |
16 | 20 | } |
17 | 21 | _cloned.css('display', 'block'); |
18 | 22 | _cloned.appendTo('#comments'); |
| 23 | + $('#comment_' + _num).find('.note_recipients').select2(); |
19 | 24 | $('#comment_' + _num).find('.input_comment_text').summernote(summernote_options); |
20 | 25 | }); |
21 | 26 |
|
|
24 | 29 | e.preventDefault(); |
25 | 30 | var _block = $(this).closest('.comment_block'); |
26 | 31 | if ($(this).data('note-text') == $(this).find('.text').text()){ |
27 | | - // Switch to comment |
| 32 | + // Switch to reply |
28 | 33 | $(this).find('i.fas').removeClass('fa-comment').addClass('fa-pencil-alt'); |
29 | 34 | _block.find('.input_response_type').val('reply'); |
30 | 35 | $(this).find('.text').text($(this).data('comment-text')); |
31 | 36 | _block.find('.note_title').hide(); |
32 | 37 | _block.find('.comment_title').show(); |
33 | 38 | _block.find('.input_comment_notification_text').closest('label').show(); |
| 39 | +
|
| 40 | + _block.find('.note_recipients').prop('disabled', true).select2('destroy').hide(); |
| 41 | + _block.find('.reply_recipients').prop('disabled', false).show().select2(); |
34 | 42 | }else{ |
35 | 43 | // Switch to internal note |
36 | 44 | $(this).find('i.fas').removeClass('fa-pencil-alt').addClass('fa-comment'); |
|
39 | 47 | _block.find('.note_title').show(); |
40 | 48 | _block.find('.comment_title').hide(); |
41 | 49 | _block.find('.input_comment_notification_text').closest('label').hide(); |
| 50 | +
|
| 51 | + _block.find('.reply_recipients').prop('disabled', true).select2('destroy').hide(); |
| 52 | + _block.find('.note_recipients').prop('disabled', false).show().select2(); |
42 | 53 | } |
43 | 54 | }); |
44 | 55 |
|
|
0 commit comments