diff --git a/js/browseMgr_5.1.js b/js/browseMgr_5.1.js index 8ab9e6a..0feeb57 100644 --- a/js/browseMgr_5.1.js +++ b/js/browseMgr_5.1.js @@ -1015,6 +1015,7 @@ $(document).ready(function() { var cid = $(this).attr('id'); var queryComment = false; var idClass = $(this).attr('class'); + var parentClass = $(this).parent().attr('class'); filterOn = true; if (idClass.includes("filterRiferimentiOn")) { @@ -1027,10 +1028,15 @@ $(document).ready(function() { if (!hasCommentsJson(cid)) { return } - if (showingComments) { + if (getListaIdCommenti().length>0) { if (filterOn) { - $(".filterRiferimentiOn").css('display', 'inline-block'); - $(".filterRiferimentiOff").css('display', 'none'); + if (parentClass.includes("mark")){ + $(".filterRiferimentiOn").css('display', 'inline-block'); + $(".filterRiferimentiOff").css('display', 'none'); + }else{ + $(".filterRiferimentiOn").css('display', 'none'); + $(".filterRiferimentiOff").css('display', 'none'); + } } else { $(".filterRiferimentiOff").css('display', 'inline-block'); $(".filterRiferimentiOn").css('display', 'none'); @@ -1140,11 +1146,18 @@ $(document).ready(function() { } var toTitleCase = str => str.replace(/(^\w|\s\w)(\S*)/g, (_, m1, m2) => m1.toUpperCase() + m2.toLowerCase()) - function createNoteEntry(comments, id, pos, queryComment) { + function isCommentInResult(idComment){ const tmplistaidcomm = getListaIdCommenti() + if (tmplistaidcomm.length && tmplistaidcomm.includes(idComment)) { + return true; + } + return false; + } + + function createNoteEntry(comments, id, pos, queryComment) { var idref = comments.Id - if (tmplistaidcomm.length && tmplistaidcomm.includes(idref)) { // Nik riferimenti + if (isCommentInResult(idref)) { var noteCard = $('