mirror of
https://github.com/nunocoracao/blowfish.git
synced 2025-01-22 22:45:42 -06:00
small bug fix volume 2 - like button
This commit is contained in:
parent
ea8ad8ba7c
commit
80d2a65a0c
3 changed files with 11 additions and 10 deletions
|
@ -33,9 +33,9 @@ if (typeof auth !== 'undefined') {
|
||||||
|
|
||||||
if (liked) {
|
if (liked) {
|
||||||
liked_page = true
|
liked_page = true
|
||||||
document.querySelectorAll("span[id='likes_button_heart']")[0].style.display = ""
|
document.querySelectorAll("span[id='button_likes_heart']")[0].style.display = ""
|
||||||
document.querySelectorAll("span[id='likes_button_emtpty_heart']")[0].style.display = "none"
|
document.querySelectorAll("span[id='button_likes_emtpty_heart']")[0].style.display = "none"
|
||||||
document.querySelectorAll("span[id='likes_button_text']")[0].innerText = ""
|
document.querySelectorAll("span[id='button_likes_text']")[0].innerText = ""
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -47,9 +47,9 @@ function like_article(id_likes) {
|
||||||
docRef.get().then((doc) => {
|
docRef.get().then((doc) => {
|
||||||
liked_page = true
|
liked_page = true
|
||||||
localStorage.setItem(id_likes, true);
|
localStorage.setItem(id_likes, true);
|
||||||
document.querySelectorAll("span[id='likes_button_heart']")[0].style.display = ""
|
document.querySelectorAll("span[id='button_likes_heart']")[0].style.display = ""
|
||||||
document.querySelectorAll("span[id='likes_button_emtpty_heart']")[0].style.display = "none"
|
document.querySelectorAll("span[id='button_likes_emtpty_heart']")[0].style.display = "none"
|
||||||
document.querySelectorAll("span[id='likes_button_text']")[0].innerText = ""
|
document.querySelectorAll("span[id='button_likes_text']")[0].innerText = ""
|
||||||
if (doc.exists) {
|
if (doc.exists) {
|
||||||
db.collection('likes').doc(id_likes).update({
|
db.collection('likes').doc(id_likes).update({
|
||||||
likes: firebase.firestore.FieldValue.increment(1)
|
likes: firebase.firestore.FieldValue.increment(1)
|
||||||
|
@ -75,9 +75,9 @@ function remove_like_article(id_likes) {
|
||||||
docRef.get().then((doc) => {
|
docRef.get().then((doc) => {
|
||||||
liked_page = false
|
liked_page = false
|
||||||
localStorage.removeItem(id_likes);
|
localStorage.removeItem(id_likes);
|
||||||
document.querySelectorAll("span[id='likes_button_heart']")[0].style.display = "none"
|
document.querySelectorAll("span[id='button_likes_heart']")[0].style.display = "none"
|
||||||
document.querySelectorAll("span[id='likes_button_emtpty_heart']")[0].style.display = ""
|
document.querySelectorAll("span[id='button_likes_emtpty_heart']")[0].style.display = ""
|
||||||
document.querySelectorAll("span[id='likes_button_text']")[0].innerText = "\xa0Like"
|
document.querySelectorAll("span[id='button_likes_text']")[0].innerText = "\xa0Like"
|
||||||
if (doc.exists) {
|
if (doc.exists) {
|
||||||
db.collection('likes').doc(id_likes).update({
|
db.collection('likes').doc(id_likes).update({
|
||||||
likes: firebase.firestore.FieldValue.increment(-1)
|
likes: firebase.firestore.FieldValue.increment(-1)
|
||||||
|
|
|
@ -8,6 +8,7 @@ if (typeof auth !== 'undefined') {
|
||||||
|
|
||||||
function toggleLoaders(node){
|
function toggleLoaders(node){
|
||||||
var classesString = node.className;
|
var classesString = node.className;
|
||||||
|
if(classesString == "") return
|
||||||
var classes = classesString.split(" ");
|
var classes = classesString.split(" ");
|
||||||
for(var i in classes){
|
for(var i in classes){
|
||||||
node.classList.toggle(classes[i])
|
node.classList.toggle(classes[i])
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "hugo-blowfish-theme",
|
"name": "hugo-blowfish-theme",
|
||||||
"version": "2.47.1",
|
"version": "2.47.2",
|
||||||
"description": "Blowfish theme for Hugo",
|
"description": "Blowfish theme for Hugo",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"fullinstall": "npm run preinstall && npm install && npm run postinstall",
|
"fullinstall": "npm run preinstall && npm install && npm run postinstall",
|
||||||
|
|
Loading…
Reference in a new issue