feat(web): add handling tag description
This commit is contained in:
parent
d133400103
commit
cc55219e46
@ -49,6 +49,7 @@ function menu_view_tag_open() {
|
|||||||
$("#menu-tag-view").css("display", "flex");
|
$("#menu-tag-view").css("display", "flex");
|
||||||
$("#menu-tag-view .list-item").css("display", "");
|
$("#menu-tag-view .list-item").css("display", "");
|
||||||
$("#tag-name").val(decodeURI(current_tanzaku.name));
|
$("#tag-name").val(decodeURI(current_tanzaku.name));
|
||||||
|
$("#description").val(current_tanzaku.desc);
|
||||||
let resp = tdb_query(db_name, 40, '' + current_tanzaku.id);
|
let resp = tdb_query(db_name, 40, '' + current_tanzaku.id);
|
||||||
if (!resp.status) {
|
if (!resp.status) {
|
||||||
alert("Something went wrong!");
|
alert("Something went wrong!");
|
||||||
@ -78,6 +79,7 @@ function menu_view_tag_close() {
|
|||||||
$("#menu-tag-view").css("display", "none");
|
$("#menu-tag-view").css("display", "none");
|
||||||
$("#menu-tag-view .list-item").removeClass("selected").css("display", "");
|
$("#menu-tag-view .list-item").removeClass("selected").css("display", "");
|
||||||
$("#tag-name").val("");
|
$("#tag-name").val("");
|
||||||
|
$("#description").val("");
|
||||||
}
|
}
|
||||||
|
|
||||||
function menu_add_open() {
|
function menu_add_open() {
|
||||||
@ -278,14 +280,16 @@ $(document).on("submit", "#menu-file-view form", function (e) {
|
|||||||
$(document).on("submit", "#menu-tag-view form", function (e) {
|
$(document).on("submit", "#menu-tag-view form", function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
let resp;
|
let resp;
|
||||||
let name = $("#tag-name").val();
|
let name = $("#tag-name").val(),
|
||||||
if (name !== current_tanzaku.name) {
|
desc = $("#description").val();
|
||||||
resp = tdb_query(db_name, 36, '' + current_tanzaku.id + ' ' + name + '\n' + current_tanzaku.desc);
|
if (name !== current_tanzaku.name || desc !== current_tanzaku.desc) {
|
||||||
|
resp = tdb_query(db_name, 36, '' + current_tanzaku.id + ' ' + name + '\n' + desc);
|
||||||
if (!resp.status) {
|
if (!resp.status) {
|
||||||
alert("Something went wrong!");
|
alert("Something went wrong!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
current_tanzaku.name = name;
|
current_tanzaku.name = name;
|
||||||
|
current_tanzaku.desc = desc;
|
||||||
$(`.tanzaku[tid=${current_tanzaku.id}]`).text(name);
|
$(`.tanzaku[tid=${current_tanzaku.id}]`).text(name);
|
||||||
}
|
}
|
||||||
resp = tdb_query(db_name, 40, '' + current_tanzaku.id);
|
resp = tdb_query(db_name, 40, '' + current_tanzaku.id);
|
||||||
|
|||||||
@ -71,7 +71,6 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="menu-wrapper" id="menu-tag-view">
|
<div class="menu-wrapper" id="menu-tag-view">
|
||||||
<div class="menu">
|
<div class="menu">
|
||||||
<h2>Tag menu</h2>
|
|
||||||
<form>
|
<form>
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label class="col-form-label" for="tag-name">Tag name</label>
|
<label class="col-form-label" for="tag-name">Tag name</label>
|
||||||
@ -79,6 +78,10 @@
|
|||||||
<input type="text" name="name" class="form-control" id="tag-name">
|
<input type="text" name="name" class="form-control" id="tag-name">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="description">Tag description</label>
|
||||||
|
<textarea class="form-control" name="description" id="description" rows="2"></textarea>
|
||||||
|
</div>
|
||||||
<div class="form-group form-check">
|
<div class="form-group form-check">
|
||||||
<input type="checkbox" name="selection-filter" class="form-check-input" id="tag-selection-filter">
|
<input type="checkbox" name="selection-filter" class="form-check-input" id="tag-selection-filter">
|
||||||
<label class="form-check-label" for="tag-selection-filter">Show only selected</label>
|
<label class="form-check-label" for="tag-selection-filter">Show only selected</label>
|
||||||
|
|||||||
@ -46,7 +46,6 @@
|
|||||||
</main>
|
</main>
|
||||||
<div class="menu-wrapper" id="menu-tag-view">
|
<div class="menu-wrapper" id="menu-tag-view">
|
||||||
<div class="menu">
|
<div class="menu">
|
||||||
<h2>Tag menu</h2>
|
|
||||||
<form>
|
<form>
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label class="col-form-label" for="tag-name">Tag name</label>
|
<label class="col-form-label" for="tag-name">Tag name</label>
|
||||||
@ -54,6 +53,10 @@
|
|||||||
<input type="text" name="name" class="form-control" id="tag-name">
|
<input type="text" name="name" class="form-control" id="tag-name">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="description">Tag description</label>
|
||||||
|
<textarea class="form-control" name="description" id="description" rows="2"></textarea>
|
||||||
|
</div>
|
||||||
<div class="form-group form-check">
|
<div class="form-group form-check">
|
||||||
<input type="checkbox" name="selection-filter" class="form-check-input" id="tag-selection-filter">
|
<input type="checkbox" name="selection-filter" class="form-check-input" id="tag-selection-filter">
|
||||||
<label class="form-check-label" for="tag-selection-filter">Show only selected</label>
|
<label class="form-check-label" for="tag-selection-filter">Show only selected</label>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user