Check if dom element exist before change
This commit is contained in:
4
resources/assets/js/plugins/bulk-action.js
vendored
4
resources/assets/js/plugins/bulk-action.js
vendored
@ -39,6 +39,7 @@ export default class BulkAction {
|
|||||||
|
|
||||||
if (!this.count) {
|
if (!this.count) {
|
||||||
this.show = false;
|
this.show = false;
|
||||||
|
this.hideSearchHTML();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -46,6 +47,7 @@ export default class BulkAction {
|
|||||||
selectAll() {
|
selectAll() {
|
||||||
this.show = false;
|
this.show = false;
|
||||||
this.selected = [];
|
this.selected = [];
|
||||||
|
this.hideSearchHTML();
|
||||||
|
|
||||||
if (!this.select_all) {
|
if (!this.select_all) {
|
||||||
this.show = true;
|
this.show = true;
|
||||||
@ -181,7 +183,9 @@ export default class BulkAction {
|
|||||||
hideSearchHTML() {
|
hideSearchHTML() {
|
||||||
setInterval(() => {
|
setInterval(() => {
|
||||||
const search_box_html = document.querySelector('.js-search-box-hidden');
|
const search_box_html = document.querySelector('.js-search-box-hidden');
|
||||||
|
if (search_box_html) {
|
||||||
search_box_html.classList.add('d-none');
|
search_box_html.classList.add('d-none');
|
||||||
|
}
|
||||||
}, 5);
|
}, 5);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user