From 27775e22fff4eeb145aee80693f2f0afe7c70921 Mon Sep 17 00:00:00 2001 From: Anthony Geourjon <anthony.geourjon@tetras-libre.fr> Date: Wed, 15 Jan 2025 19:28:31 +0100 Subject: [PATCH] Fix error when commentInfoGroup dont contains id --- macao/assets/custom.js | 20 +++++++++++--------- macao/themes/macao-hugo-theme | 2 +- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/macao/assets/custom.js b/macao/assets/custom.js index 076c6c5..61f6bee 100644 --- a/macao/assets/custom.js +++ b/macao/assets/custom.js @@ -14,15 +14,17 @@ $(document).ready(function() { // Comment popover $('[spanid]').addClass('comment-trigger').each(function (){ const spanid = $(this).attr('spanid'); - console.log(spanid); - $(this).popover({ - trigger: 'click', - html: true, - placement: 'auto', - content: function () { - return $("[commentaireid=" + spanid + "]").html(); - } - }); + + if($("[commentaireid=" + spanid + "]").length !== 0) { + $(this).popover({ + trigger: 'click', + html: true, + placement: 'auto', + content: function () { + return $("[commentaireid=" + spanid + "]").html(); + } + }); + } }); $(document).on('click', function() { diff --git a/macao/themes/macao-hugo-theme b/macao/themes/macao-hugo-theme index a6970e4..b5ca12c 160000 --- a/macao/themes/macao-hugo-theme +++ b/macao/themes/macao-hugo-theme @@ -1 +1 @@ -Subproject commit a6970e449194b8568d9303f099ef591025180f58 +Subproject commit b5ca12c7a576389bc20ad0d90bc4c106a4a1cbb6 -- GitLab