Skip to content

Commit

Permalink
#23 Add delete button when close clicked on table
Browse files Browse the repository at this point in the history
* Also tidy up conditions + html.
  • Loading branch information
Jack-Dane committed Oct 26, 2023
1 parent afe7132 commit d4d0b24
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions admin/pageHelpers/table_display.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class SaveButton extends TableButtonBase {
).then(function (response) {
tableDisplay.displayTable();

if (response.status != 200) {
if (response.status !== 200) {
let jsonPromise = Promise.resolve(response.json());

jsonPromise.then(function (jsonResponse) {
Expand Down Expand Up @@ -221,7 +221,7 @@ class RowField {
return;
}

let input = jQuery("<input></input>");
let input = jQuery("<input>");
input.attr("value", this.text);

this.dataElement.replaceWith(input);
Expand Down Expand Up @@ -481,6 +481,7 @@ class TableRow extends BaseTableRow {
this.closeButton.hide();
this.saveButton.hide();
this.editButton.show();
this.deleteButton.show();
this.#closeFields();
}

Expand Down Expand Up @@ -745,7 +746,7 @@ class TableDisplay {
}

#addNextButton() {
if (jQuery("#next-button").length != 0) {
if (jQuery("#next-button").length !== 0) {
// button is already on the screen
return;
}
Expand All @@ -759,7 +760,7 @@ class TableDisplay {
}

#addPreviousButton() {
if (jQuery("#previous-button").length != 0) {
if (jQuery("#previous-button").length !== 0) {
// button is already on the screen
return;
}
Expand Down

0 comments on commit d4d0b24

Please sign in to comment.