From 99ee7420e71680e056c9e2cdf55a1c1c7e528ad7 Mon Sep 17 00:00:00 2001 From: Rudis Muiznieks Date: Mon, 25 Sep 2023 14:57:58 -0500 Subject: [PATCH] wip --- static/script.js | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/static/script.js b/static/script.js index 868d12b..46feeb2 100644 --- a/static/script.js +++ b/static/script.js @@ -5,20 +5,7 @@ if (document.readyState && document.readyState !== 'loading') { } function configureSummarizeButtons() { - var buttons = document.querySelectorAll('.kagi-summary a.btn'); - console.log(`configuring ${buttons.length} buttons`); - for (var i = 0; i < buttons.length; i++) { - let button = buttons[i]; - let url = button.dataset.url; - button.addEventListener('click', function(e) { - e.preventDefault(); - e.stopPropagation(); - - if (url) { - console.log(url); - } else { - console.log('no url'); - } - }); - } + $('#global').on('click', '.kagi-summary a.btn', function() { + console.log(this.dataset.url); + }); }