Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion catatan_rilis.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ Terimakasih [isi disini] yang telah berkontribusi langsung mengembangkan aplikas
#### FITUR

1. [#1498](https://github.com/OpenSID/OpenDK/issues/1497) Halaman public setelah login mengarah ke halaman dashboard
2. [#1539](https://github.com/OpenSID/OpenDK/issues/1539) Tambahkan tanggal terbit pada postingan artike
2. [#1539](https://github.com/OpenSID/OpenDK/issues/1539) Tambahkan tanggal terbit pada postingan artikel
3. [#1548](https://github.com/OpenSID/OpenDK/issues/1548) Tambahkan fungsi global untuk debounce search datatable

#### BUG

Expand Down
30 changes: 29 additions & 1 deletion resources/views/partials/asset_datatables.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,35 @@
$.extend($.fn.dataTable.defaults, {
language: {
url: "{{ asset('/bower_components/datatables.net/i18n/id.json') }}"
}
},
searchDelay: 500,
});
$(document).on('init.dt', function(e, settings) {
if (e.namespace !== 'dt') return;

var table = new $.fn.dataTable.Api(settings);
var searchDelay = table.init().searchDelay || 500;
var searchInput = $('div.dataTables_filter input', table.table().container());
var debounceTimer = null;
var previousSearch = null;

searchInput.off('keyup.DT input.DT search.DT keydown.DT');

searchInput.on('keyup input', function() {
var currentValue = this.value;

if (previousSearch === currentValue) return;

previousSearch = currentValue;

clearTimeout(debounceTimer);

debounceTimer = setTimeout(function() {
if (table.search() !== currentValue) {
table.search(currentValue).draw();
}
}, searchDelay);
});
});
</script>
@endpush