Fix stuck tooltips

Fix stuck tooltips by implementing custom data  request function, and destroying existing tooltips on new data load.

Fixes #81
This commit is contained in:
Phillip Kühne 2024-02-16 12:32:37 +01:00
parent 43a12228ae
commit 06594855d6
Signed by: phillip
GPG Key ID: E4C1C4D2F90902AA
3 changed files with 11 additions and 3 deletions

View File

@ -187,6 +187,14 @@
return entries;
}
function dataRequestQueueAndDestroyTooltips(params) {
document.querySelectorAll(".tooltip[role='tooltip']").forEach((tooltip) => tooltip.remove());
var base_url = "/api/queue"
$.get(base_url).then((res) => {
params.success(res);
});
}
</script>
</body>

View File

@ -4,7 +4,7 @@
<a id="bfb" role="button" class="btn btn-primary btn-lg btn-block mb-2" href="/list">Eintragen</a>
<table class="table entries"
data-toggle="table"
data-url="/api/queue"
data-ajax="dataRequestQueueAndDestroyTooltips"
data-pagination="true"
data-classes="table"
data-show-refresh="false"

View File

@ -22,7 +22,7 @@
<table class="table entries" id="entrytable" data-toggle="table" data-search="true" data-show-columns="true"
data-show-toggle="true" data-multiple-select-row="true" data-click-to-select="true" data-toolbar="#toolbar"
data-pagination="true" data-show-extended-pagination="true" data-classes="table table-hover"
data-url="/api/queue" data-show-refresh="true" data-auto-refresh="true" data-auto-refresh-interval="10">
data-ajax="dataRequestQueueAndDestroyTooltips" data-show-refresh="true" data-auto-refresh="true" data-auto-refresh-interval="10">
<thead>
<tr>
<th data-field="state" data-checkbox="true"></th>
@ -153,7 +153,7 @@
$.ajax({
type: 'POST',
url: '/api/entries/delete',
data: JSON.stringify(ids), // or JSON.stringify ({name: 'jonas'}),
data: JSON.stringify(ids),
error: function () {
bootbox.alert({
message: "Fehler beim Löschen der Eintragungen.",