mirror of
https://github.com/PhoenixTwoFive/karaoqueue.git
synced 2025-05-18 18:41:48 +02:00
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:
parent
43a12228ae
commit
06594855d6
@ -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>
|
||||
|
||||
|
@ -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"
|
||||
|
@ -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.",
|
||||
|
Loading…
x
Reference in New Issue
Block a user