Merge pull request #367 from ONLYOFFICE/bugfix/fixed-table-share-icon
Bugfix/fixed table share icon
This commit is contained in:
commit
1df1e12e59
@ -226,6 +226,23 @@ class TableHeader extends React.Component {
|
||||
|
||||
const storageSize =
|
||||
!resetColumnsSize && localStorage.getItem(columnStorageName);
|
||||
|
||||
const defaultSize = this.props.columns.find((col) => col.defaultSize)
|
||||
?.defaultSize;
|
||||
|
||||
//TODO: Fixed columns size if something went wrong
|
||||
if (storageSize) {
|
||||
const splitStorage = storageSize.split(" ");
|
||||
|
||||
if (
|
||||
defaultSize &&
|
||||
splitStorage[splitStorage.length - 2] !== `${defaultSize}px`
|
||||
) {
|
||||
localStorage.removeItem(columnStorageName);
|
||||
return this.onResize();
|
||||
}
|
||||
}
|
||||
|
||||
const tableContainer = storageSize
|
||||
? storageSize.split(" ")
|
||||
: container.style.gridTemplateColumns.split(" ");
|
||||
@ -275,12 +292,11 @@ class TableHeader extends React.Component {
|
||||
const newItemWidth = (containerWidth * percent) / 100 + "px";
|
||||
gridTemplateColumns.push(newItemWidth);
|
||||
} else {
|
||||
const newItemWidth =
|
||||
percent === 0
|
||||
? defaultSize
|
||||
? `${defaultSize}px`
|
||||
: `${minColumnSize}px`
|
||||
: (containerWidth * percent) / 100 + "px";
|
||||
const newItemWidth = defaultSize
|
||||
? `${defaultSize}px`
|
||||
: percent === 0
|
||||
? `${minColumnSize}px`
|
||||
: (containerWidth * percent) / 100 + "px";
|
||||
|
||||
gridTemplateColumns.push(newItemWidth);
|
||||
}
|
||||
@ -295,9 +311,6 @@ class TableHeader extends React.Component {
|
||||
|
||||
str = gridTemplateColumns.join(" ");
|
||||
} else {
|
||||
const defaultSize = this.props.columns.find((col) => col.defaultSize)
|
||||
?.defaultSize;
|
||||
|
||||
const column =
|
||||
(newContainerWidth * (isSingleTable ? 60 : 100)) / 100 -
|
||||
(defaultSize || 0) -
|
||||
|
@ -74,7 +74,7 @@ class FilesTableHeader extends React.Component {
|
||||
key: "Share",
|
||||
title: "",
|
||||
enable: withContent,
|
||||
defaultSize: 80,
|
||||
defaultSize: 120,
|
||||
resizable: false,
|
||||
},
|
||||
];
|
||||
@ -188,12 +188,12 @@ class FilesTableHeader extends React.Component {
|
||||
{cbMenuItems.map((key) => {
|
||||
const label = getCheckboxItemLabel(t, key);
|
||||
return (
|
||||
<DropDownItem
|
||||
<DropDownItem
|
||||
key={key}
|
||||
label={label}
|
||||
data-key={key}
|
||||
onClick={this.onSelect}
|
||||
/>
|
||||
onClick={this.onSelect}
|
||||
/>
|
||||
);
|
||||
})}
|
||||
</>
|
||||
|
@ -35,6 +35,7 @@ const StyledDragAndDrop = styled(DragAndDrop)`
|
||||
|
||||
const StyledShare = styled.div`
|
||||
cursor: pointer;
|
||||
margin: 0 auto;
|
||||
|
||||
.share-button {
|
||||
padding: 4px;
|
||||
|
Loading…
Reference in New Issue
Block a user