Skip to content

Commit eb305e2

Browse files
committed
Scripts that link embedded comments and ticket visibility
1 parent 4435420 commit eb305e2

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

src/Views/tickets/createedit/scripts.blade.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,16 @@
2222
var category_id=<?=$a_current['cat_id'];?>;
2323
2424
$(function(){
25+
// Change visibility affects embedded comments
26+
$('input[name=hidden]').click(function(e){
27+
if ($(this).val() == 'true'){
28+
$('.input_response_type[value=reply]:enabled').closest('.comment_block').find('.switch_response_type').trigger('click');
29+
$('.input_response_type:enabled').closest('.comment_block').find('.switch_response_type').hide();
30+
}else{
31+
$('.input_response_type:enabled').closest('.comment_block').find('.switch_response_type').show();
32+
}
33+
});
34+
2535
// Change in List affects current status
2636
$('.jquery_ticket_list').click(function(){
2737
var new_status = "";

src/Views/tickets/partials/comments/new_in_createedit_ticket_scripts.blade.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
_cloned.find('.input_comment_num').val(_num);
1111
_cloned.find('.input_response_type').prop('disabled', false).attr('name', 'response_' + _num);
1212
_cloned.find('.input_comment_text').prop('disabled', false).attr('name', 'comment_' + _num);
13+
if ($('input[name=hidden]:checked').val() == 'true'){
14+
_cloned.find('.switch_response_type').hide();
15+
}
1316
_cloned.css('display', 'block');
1417
_cloned.appendTo('#comments');
1518
$('#comment_' + _num).find('.input_comment_text').summernote(summernote_options);

0 commit comments

Comments
 (0)