add favorite action underneath image

This commit is contained in:
r888888888
2017-09-05 14:41:33 -07:00
parent 93ce433c0c
commit bb228d5735
6 changed files with 18 additions and 5 deletions

View File

@@ -13,13 +13,17 @@
if (current_user_id == "") {
$("#add-to-favorites").hide();
$("#remove-from-favorites").hide();
$("#add-fav-button").hide();
$("#remove-fav-button").hide();
return;
}
var regexp = new RegExp("\\bfav:" + current_user_id + "\\b");
if ((favorites != undefined) && (favorites.match(regexp))) {
$("#add-to-favorites").hide();
$("#add-fav-button").hide();
} else {
$("#remove-from-favorites").hide();
$("#remove-fav-button").hide();
}
}