alpakas-theme/js/pages/news/events.js

25 lines
808 B
JavaScript
Raw Normal View History

2021-08-26 10:02:33 +00:00
function windowScroll() {
showMobileCalltoaction();
}
function buttonClickLike(){
let newData = {};
newData["id"] = database.attr("data-new-id");
newData["url"] = database.attr("data-new-url");
newData["title"] = database.attr("data-new-title");
newData["date"] = database.attr("data-new-date");
newData["author_url"] = database.attr("data-author-url");
newData["author_name"] = database.attr("data-author-name");
newData["author_image"] = database.attr("data-author-image");
if(!$(this).hasClass("like")) {
objLikes.push(newData.id);
objLikesData.push(newData);
}
else {
let index = removeItemOnce(objLikes, newData.id);
objLikesData.splice(index, 1);
}
$(this).toggleClass("like");
updateLikesInLocalStorage();
}