fix(overview): center empty state messages and disable scroll when list is empty
CI / Build & Test (push) Successful in 2m55s
CI / Build & Test (push) Successful in 2m55s
Add ov-empty CSS class to .ov-scroll-area when an overview list has no items — disables overflow scrolling and uses flexbox to vertically and horizontally center the empty message. Class is removed automatically when data is present. Keeps the normal scrollable layout intact for populated lists.
This commit is contained in:
@@ -18,6 +18,7 @@ class OvList {
|
||||
this.sentinel = $(sentinelId);
|
||||
this.searchEl = $(searchId);
|
||||
this.subtitleEl = $(subtitleId);
|
||||
this.scrollArea = this.body?.closest('.ov-scroll-area') || null;
|
||||
this.rowFn = rowFn;
|
||||
this.emptyMsg = emptyMsg;
|
||||
this.cols = cols;
|
||||
@@ -66,8 +67,10 @@ class OvList {
|
||||
this.body.innerHTML = '';
|
||||
if (this.filtered.length === 0) {
|
||||
this.body.innerHTML = `<tr><td colspan="${this.cols}" class="empty">${this.emptyMsg}</td></tr>`;
|
||||
this.scrollArea?.classList.add('ov-empty');
|
||||
return;
|
||||
}
|
||||
this.scrollArea?.classList.remove('ov-empty');
|
||||
this._appendPage();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user