tweak kudos javascript

This commit is contained in:
John Bowdre 2024-06-25 21:13:32 -05:00
parent 7c378779d3
commit df68d87e0b
2 changed files with 7 additions and 7 deletions

View file

@ -2,9 +2,9 @@
window.onload = function() { window.onload = function() {
// get the button and text elements // get the button and text elements
var kudosButton = document.querySelector('.kudos-button'); const kudosButton = document.querySelector('.kudos-button');
var kudosText = document.querySelector('.kudos-text'); const kudosText = document.querySelector('.kudos-text');
var emojiSpan = kudosButton.querySelector('.emoji'); const emojiSpan = kudosButton.querySelector('.emoji');
kudosButton.addEventListener('click', function(event) { kudosButton.addEventListener('click', function(event) {
// send the event to Cabin // send the event to Cabin

View file

@ -1,7 +1,7 @@
--- ---
title: "Kudos With Cabin" title: "Kudos With Cabin"
date: 2024-06-24 date: 2024-06-24
# lastmod: 2024-06-24 lastmod: "2024-06-26T02:13:13Z"
description: "Using Cabin's event tracking to add a simple post upvote widget to my Hugo site." description: "Using Cabin's event tracking to add a simple post upvote widget to my Hugo site."
featured: false featured: false
toc: true toc: true
@ -127,9 +127,9 @@ I want the button to do a little bit more than *just* send the event to Cabin so
window.onload = function() { window.onload = function() {
// get the button and text elements // get the button and text elements
var kudosButton = document.querySelector('.kudos-button'); const kudosButton = document.querySelector('.kudos-button');
var kudosText = document.querySelector('.kudos-text'); const kudosText = document.querySelector('.kudos-text');
var emojiSpan = kudosButton.querySelector('.emoji'); const emojiSpan = kudosButton.querySelector('.emoji');
kudosButton.addEventListener('click', function(event) { kudosButton.addEventListener('click', function(event) {
// send the event to Cabin // send the event to Cabin