This commit is contained in:
Yuri Kuznetsov
2024-10-30 19:02:14 +02:00
parent 36ba328437
commit a6d6042bd7
2 changed files with 1 additions and 57 deletions
+1 -2
View File
@@ -138,13 +138,12 @@
{{#if collectionLength}}
<div
class="list{{#if tableMinWidth}} scrollable{{/if}}{{#if showMoreActive}} has-show-more{{/if}}"
class="list {{#if showMoreActive}} has-show-more {{/if}}"
data-scope="{{scope}}"
tabindex="-1"
>
<table
class="table {{#if hasColumnResize~}} column-resizable {{~/if}}"
{{#if tableMinWidth}} style="min-width: {{tableMinWidth}}px;"{{/if}}
>
{{#if header}}
<thead>
-55
View File
@@ -185,9 +185,6 @@ class ListRecordView extends View {
/** @protected */
checkboxColumnWidth = 40
/** @protected */
minColumnWidth = 100
/**
* A button. Handled by a class method `action{Name}` or a handler.
*
@@ -3485,58 +3482,6 @@ class ListRecordView extends View {
return this.checkedList.indexOf(id) !== -1;
}
// noinspection JSUnusedGlobalSymbols
getTableMinWidth() {
if (!this.listLayout) {
return;
}
const factor = this._fontSizeFactor;
let totalWidth = 0;
let totalWidthPx = 0;
let emptyCount = 0;
let columnCount = 0;
this.listLayout.forEach((item) => {
columnCount ++;
if (item.widthPx) {
totalWidthPx += item.widthPx;
return;
}
if (item.width) {
totalWidth += item.width;
return;
}
emptyCount ++;
});
if (this.rowActionsView && !this.rowActionsDisabled) {
totalWidthPx += this.rowActionsColumnWidth;
}
if (this.checkboxes) {
totalWidthPx += this.checkboxColumnWidth;
}
let minWidth;
if (totalWidth >= 100 * factor) {
minWidth = columnCount * this.minColumnWidth * factor;
}
else {
minWidth = (totalWidthPx + this.minColumnWidth * emptyCount * factor) / (1 - totalWidth / 100);
minWidth = Math.round(minWidth);
}
return minWidth;
}
setupRowActionDefs() {
this._rowActionHandlers = {};