big restructure
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import { warnOnce } from '../core/app-dom.js';
|
||||
|
||||
export function bindBulkVisibility({
|
||||
containerSelector,
|
||||
buttonSelector,
|
||||
@@ -5,7 +7,15 @@ export function bindBulkVisibility({
|
||||
} = {}) {
|
||||
const container = document.querySelector(containerSelector);
|
||||
const buttons = Array.from(document.querySelectorAll(buttonSelector));
|
||||
if (!container || !buttons.length) return { update: () => {} };
|
||||
if (!container || !buttons.length) {
|
||||
if (!container) {
|
||||
warnOnce('UI_EL_MISSING', `Missing bulk container: ${containerSelector}`, { module: 'bulk-selection' });
|
||||
}
|
||||
if (!buttons.length) {
|
||||
warnOnce('UI_EL_MISSING', `Missing bulk buttons: ${buttonSelector}`, { module: 'bulk-selection' });
|
||||
}
|
||||
return { update: () => {} };
|
||||
}
|
||||
|
||||
const update = () => {
|
||||
const selected = container.querySelectorAll(selectedRowSelector).length > 0;
|
||||
|
||||
Reference in New Issue
Block a user