feat(web): introduce tag removing

This commit is contained in:
Masahiko AMANO 2023-01-31 16:24:03 +03:00
parent b4b76fe271
commit 4b7766695e
2 changed files with 16 additions and 0 deletions

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());

View File

@ -60,6 +60,7 @@
<div class="form-group list"></div>
<div class="form-group button-flex">
<button type="submit" class="btn btn-primary" id="btn-confirm">Confirm</button>
<button class="btn btn-danger" id="btn-remove">Remove</button>
<button class="btn btn-outline-danger" id="btn-close">Close</button>
</div>
</form>