feat(web): introduce tag removing

This commit is contained in:
2023-01-31 16:24:03 +03:00
parent b4b76fe271
commit 4b7766695e
2 changed files with 16 additions and 0 deletions
+15
View File
@@ -82,6 +82,21 @@ $(document).on("submit", "#menu-view form", function (e) {
$(".list-item").removeClass("selected").css("display", "block");
});
$(document).on("click", "#btn-remove", function (e) {
e.preventDefault();
if (!confirm("This tag will be removed permanently. Are you sure?")) {
return;
}
let resp = tdb_query("$TFM", 33, '' + current_tanzaku.id);
if (!resp.status) {
alert("Something went wrong!");
return;
}
$(".menu-wrapper").css("display", "none");
$("#menu-view").css("display", "none");
location.reload(true);
});
$(document).on("submit", "#menu-add form", function (e) {
e.preventDefault();
let resp = tdb_query("$TFM", 34, $("#new-name").val() + '\n' + $("#new-description").val());