feature: change password
This commit is contained in:
+17
-10
@@ -6,7 +6,7 @@ export class AjaxTable {
|
||||
this.searchInputId = options.searchInputId || 'searchInput';
|
||||
this.btnClearSearchId = options.btnClearSearchId || 'btnClearSearch';
|
||||
this.btnClearFiltersId = options.btnClearFiltersId || 'btnClearFilters';
|
||||
this.flagSendFilterId = options.flagSendFilterId || 'flagSendFilter';
|
||||
this.statusFilterId = options.statusFilterId || 'statusFilter';
|
||||
this.monthFilterId = options.monthFilterId || 'monthFilter';
|
||||
this.skeletonColumns = options.skeletonColumns || 7;
|
||||
|
||||
@@ -22,7 +22,7 @@ export class AjaxTable {
|
||||
this.searchInput = document.getElementById(this.searchInputId);
|
||||
this.btnClearSearch = document.getElementById(this.btnClearSearchId);
|
||||
this.btnClearFilters = document.getElementById(this.btnClearFiltersId);
|
||||
this.flagSendFilter = document.getElementById(this.flagSendFilterId);
|
||||
this.statusFilter = document.getElementById(this.statusFilterId);
|
||||
this.monthFilter = document.getElementById(this.monthFilterId);
|
||||
|
||||
if (this.form) {
|
||||
@@ -35,10 +35,6 @@ export class AjaxTable {
|
||||
if (this.searchInput) {
|
||||
this.searchInput.addEventListener('input', () => {
|
||||
this.toggleClearSearchBtn();
|
||||
clearTimeout(this.searchDebounceTimer);
|
||||
this.searchDebounceTimer = setTimeout(() => {
|
||||
this.submitForm();
|
||||
}, 500);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -52,16 +48,26 @@ export class AjaxTable {
|
||||
});
|
||||
}
|
||||
|
||||
if (this.flagSendFilter) {
|
||||
this.flagSendFilter.addEventListener('change', () => {
|
||||
this.submitForm();
|
||||
if (this.form) {
|
||||
this.form.querySelectorAll('select').forEach(select => {
|
||||
select.addEventListener('change', () => {
|
||||
this.submitForm();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
if (this.btnClearFilters) {
|
||||
this.btnClearFilters.addEventListener('click', () => {
|
||||
if (this.searchInput) this.searchInput.value = '';
|
||||
if (this.flagSendFilter) this.flagSendFilter.value = '';
|
||||
if (this.statusFilter) this.statusFilter.value = '1';
|
||||
|
||||
const roleFilter = document.getElementById('roleFilter');
|
||||
if (roleFilter) roleFilter.value = '';
|
||||
const departmentFilter = document.getElementById('departmentFilter');
|
||||
if (departmentFilter) departmentFilter.value = '';
|
||||
const flagSendFilter = document.getElementById('flagSendFilter');
|
||||
if (flagSendFilter) flagSendFilter.value = '';
|
||||
|
||||
if (this.monthFilter) {
|
||||
this.monthFilter.value = new Date().toISOString().slice(0, 7);
|
||||
}
|
||||
@@ -118,6 +124,7 @@ export class AjaxTable {
|
||||
<td class="px-6 py-4"><div class="h-4 bg-gray-200 rounded w-12"></div></td>
|
||||
<td class="px-6 py-4"><div class="h-4 bg-gray-200 rounded w-16"></div></td>
|
||||
<td class="px-6 py-4"><div class="h-6 bg-gray-200 rounded-full w-20"></div></td>
|
||||
<td class="px-6 py-4"><div class="h-6 bg-gray-200 rounded-full w-20"></div></td>
|
||||
<td class="px-6 py-4"><div class="h-8 bg-gray-200 rounded w-20 ml-auto"></div></td>
|
||||
</tr>`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user