Skip to content

Commit

Permalink
Issue #15 - more work on tables
Browse files Browse the repository at this point in the history
- Ensure that after suggestion deletion the entry is redrawn in the main
table. (Possible Details button colour change)
- Don't jump to page 1 when an item is redrawn in the main table.
- Don't jump to page 1 of suggestions, when a vote is cast, a suggestion
is added, edited or deleted.
  • Loading branch information
rarog committed Nov 5, 2017
1 parent 2f0abbf commit eb06224
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions public/js/translations.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ function refreshTranslationEntry(app, resource, entry) {

table.row("#translation-" + entry)
.data(data[0])
.draw();
.draw(false);

hideModalSpinner(true);
enableBootstrapTooltips();
Expand Down Expand Up @@ -261,7 +261,7 @@ $("#modalContainer").on("click", ".suggestionVote", function(event) {
$("#modalContainer #suggestions").DataTable()
.row("#suggestion-" + suggestion)
.data(data["suggestion"])
.draw();
.draw(false);
enableBootstrapTooltips();
} else {
addModalAlertMessage();
Expand Down Expand Up @@ -336,7 +336,7 @@ $("#modalContainer").on("click", ".suggestionAddEditSubmit", function(event) {
table.row("#suggestion-" + suggestion)
.data(data["suggestion"]);
}
table.draw();
table.draw(false);

$("#modalContainer #suggestionAddEdit").collapse("hide");
enableBootstrapTooltips();
Expand Down Expand Up @@ -381,10 +381,11 @@ $("#modalContainer").on("click", ".suggestionDelete", function(event) {
var table = $("#modalContainer #suggestions").DataTable();
table.row("#suggestion-" + suggestion)
.remove();
table.draw();
table.draw(false);
}

$("#modalContainer #suggestionAddEdit").collapse("hide");
refreshTranslation = true;
} else {
addModalAlertMessage();
}
Expand Down
2 changes: 1 addition & 1 deletion public/js/translations.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit eb06224

Please sign in to comment.