From fbaa311ab5bb9158bd846bbd80cea9289b48b698 Mon Sep 17 00:00:00 2001
From: Anthony Geourjon <anthony.geourjon@tetras-libre.fr>
Date: Wed, 15 Jan 2025 19:01:14 +0100
Subject: [PATCH] WIP commment

---
 macao/assets/custom.js                       | 15 +++++++++++----
 macao/layouts/partials/docs/inject/head.html |  1 -
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/macao/assets/custom.js b/macao/assets/custom.js
index 68f94af..fc38ce4 100644
--- a/macao/assets/custom.js
+++ b/macao/assets/custom.js
@@ -8,13 +8,20 @@ $(document).ready(function() {
     $('.book-header').show();
 
     $('.commentaireInfo').hide();
-    $('.commentaireInfo').prop('popover', 'auto');
+    // $('.commentaireInfo').prop('popover', 'auto');
     $('.commentaireInfoGroup').show();
 
     // Comment popover
-    $('[spanid]').addClass('comment-trigger').on('click', function() {
-        let spanid = $(this).attr('spanid');
-        $("[commentaireid=" + spanid + "]").toggle();
+    $('[spanid]').addClass('comment-trigger').popover({
+        trigger: 'click',
+        html: true,
+        content: function () {
+            return "tt" + $(this).attr('spanid');
+        }
+    });
+
+    $(document).on('click', function() {
+        $('[spanid]').popover('hide');
     });
 
     // Simplify th in td
diff --git a/macao/layouts/partials/docs/inject/head.html b/macao/layouts/partials/docs/inject/head.html
index 1e92bac..4640eef 100644
--- a/macao/layouts/partials/docs/inject/head.html
+++ b/macao/layouts/partials/docs/inject/head.html
@@ -11,7 +11,6 @@
 
     {{- $quizjs := slice -}}
     {{- $quizjs = $quizjs | append (resources.Get "quiz.js") -}}
-    {{- $quizjs = $quizjs | append (resources.Get "custom.js") -}}
     {{- $quizjs = $quizjs | append (resources.Get "gapfill-select.js") -}}
     {{- $quizjs = $quizjs | append (resources.Get "gapfill-open.js") -}}
     {{- $quizjs = $quizjs | resources.Concat "quiz.bundle.js" -}}
-- 
GitLab