Added input for editing table description

This commit is contained in:
Matthew Welch 2021-01-11 20:55:54 -08:00
parent 6185c6181e
commit f6630ff659
2 changed files with 15 additions and 0 deletions

View File

@ -20,6 +20,10 @@
<label class="form-label">Table Name</label>
<input type="text" class="form-control" id="detail-table-name">
</div>
<div class="mb-3">
<label class="form-label">Table Description</label>
<textarea class="form-control" id="detail-table-description"></textarea>
</div>
<div class="mb-3">
<div class="form-check">
<label class="form-check-label">

View File

@ -9,6 +9,7 @@ let nav = $("nav");
let nav_scroll = nav.scrollLeft();
let detail_tab_name = $("#detail-tab-name");
let detail_table_name = $("#detail-table-name");
let detail_table_description = $("#detail-table-description");
let detail_table_hidden = $("#detail-table-hidden");
let detail_column_name = $("#detail-column-name");
let detail_column_selectable = $("#detail-column-selectable");
@ -188,6 +189,7 @@ function updateDetailsPanel() {
let data = getSelectedCellData();
detail_tab_name.val(data["tab_name"]);
detail_table_name.val(data["table_name"]);
detail_table_description.val(data["table_description"]);
detail_column_name.val(data["col_name"]);
detail_table_hidden.prop("checked", data["table_hidden"]);
detail_column_selectable.prop("checked", data["col_selectable"]);
@ -240,6 +242,7 @@ function getSelectedCellData(force_update=false) {
cell_data["table_index"] = i;
cell_data["table_name"] = table_data["name"];
cell_data["tab_name"] = table_data["tab_name"];
cell_data["table_description"] = table_data["description"];
cell_data["table_hidden"] = table_data["hidden"];
cell_data["num_rows"] = table_data["rows"].length;
cell_data["num_cols"] = table_data["columns"].length;
@ -832,6 +835,14 @@ detail_table_name.on("input", (event) => {
selected_cell_data["table_name"] = new_table_name;
});
detail_table_description.on("input", (event) => {
let input = $(event.target);
let new_table_description = input.val();
let data = getSelectedCellData();
tables_data[data["table_index"]]["description"] = new_table_description;
selected_cell_data["table_description"] = new_table_description;
})
detail_table_hidden.on("input", (event) => {
let input = $(event.target);
let table_hidden = input.prop("checked");