mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-15 01:23:53 -07:00
Fixed: Toolbar button collapsing includes separator
This commit is contained in:
parent
1a0ef56bac
commit
a29ee22167
3 changed files with 7 additions and 12 deletions
|
@ -282,11 +282,7 @@ class ArtistIndex extends Component {
|
||||||
null
|
null
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
<PageToolbarSeparator />
|
||||||
(view === 'posters' || view === 'banners' || view === 'overview') &&
|
|
||||||
|
|
||||||
<PageToolbarSeparator />
|
|
||||||
}
|
|
||||||
|
|
||||||
<ArtistIndexViewMenu
|
<ArtistIndexViewMenu
|
||||||
view={view}
|
view={view}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
.sectionContainer {
|
.sectionContainer {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex: 1 1 10%;
|
flex: 1 1 auto;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,6 @@ import styles from './PageToolbarSection.css';
|
||||||
const BUTTON_WIDTH = parseInt(dimensions.toolbarButtonWidth);
|
const BUTTON_WIDTH = parseInt(dimensions.toolbarButtonWidth);
|
||||||
const SEPARATOR_MARGIN = parseInt(dimensions.toolbarSeparatorMargin);
|
const SEPARATOR_MARGIN = parseInt(dimensions.toolbarSeparatorMargin);
|
||||||
const SEPARATOR_WIDTH = 2 * SEPARATOR_MARGIN + 1;
|
const SEPARATOR_WIDTH = 2 * SEPARATOR_MARGIN + 1;
|
||||||
const SEPARATOR_NAME = 'PageToolbarSeparator';
|
|
||||||
|
|
||||||
function calculateOverflowItems(children, isMeasured, width, collapseButtons) {
|
function calculateOverflowItems(children, isMeasured, width, collapseButtons) {
|
||||||
let buttonCount = 0;
|
let buttonCount = 0;
|
||||||
|
@ -23,9 +22,7 @@ function calculateOverflowItems(children, isMeasured, width, collapseButtons) {
|
||||||
const validChildren = [];
|
const validChildren = [];
|
||||||
|
|
||||||
forEach(children, (child) => {
|
forEach(children, (child) => {
|
||||||
const name = child.type.name;
|
if (Object.keys(child.props).length === 0) {
|
||||||
|
|
||||||
if (name === SEPARATOR_NAME) {
|
|
||||||
separatorCount++;
|
separatorCount++;
|
||||||
} else {
|
} else {
|
||||||
buttonCount++;
|
buttonCount++;
|
||||||
|
@ -68,12 +65,14 @@ function calculateOverflowItems(children, isMeasured, width, collapseButtons) {
|
||||||
}
|
}
|
||||||
|
|
||||||
validChildren.forEach((child, index) => {
|
validChildren.forEach((child, index) => {
|
||||||
|
const isSeparator = Object.keys(child.props).length === 0;
|
||||||
|
|
||||||
if (actualButtons < maxButtons) {
|
if (actualButtons < maxButtons) {
|
||||||
if (child.type.name !== SEPARATOR_NAME) {
|
if (!isSeparator) {
|
||||||
buttons.push(child);
|
buttons.push(child);
|
||||||
actualButtons++;
|
actualButtons++;
|
||||||
}
|
}
|
||||||
} else if (child.type.name !== SEPARATOR_NAME) {
|
} else if (!isSeparator) {
|
||||||
overflowItems.push(child.props);
|
overflowItems.push(child.props);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue