favourite/unfavourite in the sidebar

there's still a bug that doesn't update unfavouriting in real time
This commit is contained in:
caryoscelus 2022-08-06 00:45:27 +00:00
parent 916c494833
commit 80320105d8
3 changed files with 63 additions and 1 deletions

View file

@ -1137,6 +1137,22 @@ window.initScrollable = function () {
return false;
};
})(this));
this.tag.find("#button-favourite").off("click touched").on("click touched", (function(_this) {
return function() {
_this.tag.find("#button-favourite").addClass("hidden");
_this.tag.find("#button-unfavourite").removeClass("hidden");
_this.wrapper.ws.cmd("siteFavourite", _this.wrapper.site_info.address);
return false;
};
})(this));
this.tag.find("#button-unfavourite").off("click touched").on("click touched", (function(_this) {
return function() {
_this.tag.find("#button-favourite").removeClass("hidden");
_this.tag.find("#button-unfavourite").addClass("hidden");
_this.wrapper.ws.cmd("siteUnfavourite", _this.wrapper.site_info.address);
return false;
};
})(this));
this.tag.find("#button-delete").off("click touchend").on("click touchend", (function(_this) {
return function() {
_this.handleSiteDeleteClick();
@ -1767,4 +1783,4 @@ function morphdom(fromNode, toNode, options) {
module.exports = morphdom;
},{}]},{},[1])(1)
});
});