diff --git a/assets/js/page.js b/assets/js/page.js index 714b5d20..15936253 100644 --- a/assets/js/page.js +++ b/assets/js/page.js @@ -33,9 +33,9 @@ if (typeof auth !== 'undefined') { if (liked) { liked_page = true - document.querySelectorAll("span[id='likes_button_heart']")[0].style.display = "" - document.querySelectorAll("span[id='likes_button_emtpty_heart']")[0].style.display = "none" - document.querySelectorAll("span[id='likes_button_text']")[0].innerText = "" + document.querySelectorAll("span[id='button_likes_heart']")[0].style.display = "" + document.querySelectorAll("span[id='button_likes_emtpty_heart']")[0].style.display = "none" + document.querySelectorAll("span[id='button_likes_text']")[0].innerText = "" } } @@ -47,9 +47,9 @@ function like_article(id_likes) { docRef.get().then((doc) => { liked_page = true localStorage.setItem(id_likes, true); - document.querySelectorAll("span[id='likes_button_heart']")[0].style.display = "" - document.querySelectorAll("span[id='likes_button_emtpty_heart']")[0].style.display = "none" - document.querySelectorAll("span[id='likes_button_text']")[0].innerText = "" + document.querySelectorAll("span[id='button_likes_heart']")[0].style.display = "" + document.querySelectorAll("span[id='button_likes_emtpty_heart']")[0].style.display = "none" + document.querySelectorAll("span[id='button_likes_text']")[0].innerText = "" if (doc.exists) { db.collection('likes').doc(id_likes).update({ likes: firebase.firestore.FieldValue.increment(1) @@ -75,9 +75,9 @@ function remove_like_article(id_likes) { docRef.get().then((doc) => { liked_page = false localStorage.removeItem(id_likes); - document.querySelectorAll("span[id='likes_button_heart']")[0].style.display = "none" - document.querySelectorAll("span[id='likes_button_emtpty_heart']")[0].style.display = "" - document.querySelectorAll("span[id='likes_button_text']")[0].innerText = "\xa0Like" + document.querySelectorAll("span[id='button_likes_heart']")[0].style.display = "none" + document.querySelectorAll("span[id='button_likes_emtpty_heart']")[0].style.display = "" + document.querySelectorAll("span[id='button_likes_text']")[0].innerText = "\xa0Like" if (doc.exists) { db.collection('likes').doc(id_likes).update({ likes: firebase.firestore.FieldValue.increment(-1) diff --git a/assets/js/process.js b/assets/js/process.js index 3798ef34..a91afa76 100644 --- a/assets/js/process.js +++ b/assets/js/process.js @@ -8,6 +8,7 @@ if (typeof auth !== 'undefined') { function toggleLoaders(node){ var classesString = node.className; + if(classesString == "") return var classes = classesString.split(" "); for(var i in classes){ node.classList.toggle(classes[i]) diff --git a/package.json b/package.json index 6adf8d62..d8b0e976 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hugo-blowfish-theme", - "version": "2.47.1", + "version": "2.47.2", "description": "Blowfish theme for Hugo", "scripts": { "fullinstall": "npm run preinstall && npm install && npm run postinstall",