mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-11 15:47:09 -07:00
Fixed: Jumpbar after going back to artist index page
This commit is contained in:
parent
70342a6d29
commit
a820f3d3ca
4 changed files with 36 additions and 23 deletions
|
@ -100,7 +100,8 @@ class ArtistIndexBanners extends Component {
|
||||||
columnCount: 1,
|
columnCount: 1,
|
||||||
bannerWidth: 476,
|
bannerWidth: 476,
|
||||||
bannerHeight: 88,
|
bannerHeight: 88,
|
||||||
rowHeight: calculateRowHeight(88, null, props.isSmallScreen, {})
|
rowHeight: calculateRowHeight(88, null, props.isSmallScreen, {}),
|
||||||
|
scrollRestored: false
|
||||||
};
|
};
|
||||||
|
|
||||||
this._isInitialized = false;
|
this._isInitialized = false;
|
||||||
|
@ -120,7 +121,8 @@ class ArtistIndexBanners extends Component {
|
||||||
width,
|
width,
|
||||||
columnWidth,
|
columnWidth,
|
||||||
columnCount,
|
columnCount,
|
||||||
rowHeight
|
rowHeight,
|
||||||
|
scrollRestored
|
||||||
} = this.state;
|
} = this.state;
|
||||||
|
|
||||||
if (prevProps.sortKey !== sortKey ||
|
if (prevProps.sortKey !== sortKey ||
|
||||||
|
@ -138,6 +140,11 @@ class ArtistIndexBanners extends Component {
|
||||||
this._grid.recomputeGridSize();
|
this._grid.recomputeGridSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this._grid && scrollTop !== 0 && !scrollRestored) {
|
||||||
|
this.setState({ scrollRestored: true });
|
||||||
|
this._grid.scrollToPosition({ scrollTop });
|
||||||
|
}
|
||||||
|
|
||||||
if (jumpToCharacter != null && jumpToCharacter !== prevProps.jumpToCharacter) {
|
if (jumpToCharacter != null && jumpToCharacter !== prevProps.jumpToCharacter) {
|
||||||
const index = getIndexOfFirstCharacter(items, jumpToCharacter);
|
const index = getIndexOfFirstCharacter(items, jumpToCharacter);
|
||||||
|
|
||||||
|
@ -151,9 +158,6 @@ class ArtistIndexBanners extends Component {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this._grid && scrollTop !== 0) {
|
|
||||||
this._grid.scrollToPosition({ scrollTop });
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
|
@ -60,7 +60,8 @@ class ArtistIndexOverviews extends Component {
|
||||||
columnCount: 1,
|
columnCount: 1,
|
||||||
posterWidth: 238,
|
posterWidth: 238,
|
||||||
posterHeight: 238,
|
posterHeight: 238,
|
||||||
rowHeight: calculateRowHeight(238, null, props.isSmallScreen, {})
|
rowHeight: calculateRowHeight(238, null, props.isSmallScreen, {}),
|
||||||
|
scrollRestored: false
|
||||||
};
|
};
|
||||||
|
|
||||||
this._grid = null;
|
this._grid = null;
|
||||||
|
@ -77,7 +78,8 @@ class ArtistIndexOverviews extends Component {
|
||||||
|
|
||||||
const {
|
const {
|
||||||
width,
|
width,
|
||||||
rowHeight
|
rowHeight,
|
||||||
|
scrollRestored
|
||||||
} = this.state;
|
} = this.state;
|
||||||
|
|
||||||
if (prevProps.sortKey !== sortKey ||
|
if (prevProps.sortKey !== sortKey ||
|
||||||
|
@ -93,6 +95,11 @@ class ArtistIndexOverviews extends Component {
|
||||||
this._grid.recomputeGridSize();
|
this._grid.recomputeGridSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this._grid && scrollTop !== 0 && !scrollRestored) {
|
||||||
|
this.setState({ scrollRestored: true });
|
||||||
|
this._grid.scrollToPosition({ scrollTop });
|
||||||
|
}
|
||||||
|
|
||||||
if (jumpToCharacter != null && jumpToCharacter !== prevProps.jumpToCharacter) {
|
if (jumpToCharacter != null && jumpToCharacter !== prevProps.jumpToCharacter) {
|
||||||
const index = getIndexOfFirstCharacter(items, jumpToCharacter);
|
const index = getIndexOfFirstCharacter(items, jumpToCharacter);
|
||||||
|
|
||||||
|
@ -104,10 +111,6 @@ class ArtistIndexOverviews extends Component {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this._grid && scrollTop !== 0) {
|
|
||||||
this._grid.scrollToPosition({ scrollTop });
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
|
@ -100,7 +100,8 @@ class ArtistIndexPosters extends Component {
|
||||||
columnCount: 1,
|
columnCount: 1,
|
||||||
posterWidth: 238,
|
posterWidth: 238,
|
||||||
posterHeight: 238,
|
posterHeight: 238,
|
||||||
rowHeight: calculateRowHeight(238, null, props.isSmallScreen, {})
|
rowHeight: calculateRowHeight(238, null, props.isSmallScreen, {}),
|
||||||
|
scrollRestored: false
|
||||||
};
|
};
|
||||||
|
|
||||||
this._isInitialized = false;
|
this._isInitialized = false;
|
||||||
|
@ -122,7 +123,8 @@ class ArtistIndexPosters extends Component {
|
||||||
width,
|
width,
|
||||||
columnWidth,
|
columnWidth,
|
||||||
columnCount,
|
columnCount,
|
||||||
rowHeight
|
rowHeight,
|
||||||
|
scrollRestored
|
||||||
} = this.state;
|
} = this.state;
|
||||||
|
|
||||||
if (prevProps.sortKey !== sortKey ||
|
if (prevProps.sortKey !== sortKey ||
|
||||||
|
@ -140,6 +142,11 @@ class ArtistIndexPosters extends Component {
|
||||||
this._grid.recomputeGridSize();
|
this._grid.recomputeGridSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this._grid && scrollTop !== 0 && !scrollRestored) {
|
||||||
|
this.setState({ scrollRestored: true });
|
||||||
|
this._grid.scrollToPosition({ scrollTop });
|
||||||
|
}
|
||||||
|
|
||||||
if (jumpToCharacter != null && jumpToCharacter !== prevProps.jumpToCharacter) {
|
if (jumpToCharacter != null && jumpToCharacter !== prevProps.jumpToCharacter) {
|
||||||
const index = getIndexOfFirstCharacter(items, jumpToCharacter);
|
const index = getIndexOfFirstCharacter(items, jumpToCharacter);
|
||||||
|
|
||||||
|
@ -152,10 +159,6 @@ class ArtistIndexPosters extends Component {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this._grid && scrollTop !== 0) {
|
|
||||||
this._grid.scrollToPosition({ scrollTop });
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
|
@ -37,7 +37,8 @@ class VirtualTable extends Component {
|
||||||
super(props, context);
|
super(props, context);
|
||||||
|
|
||||||
this.state = {
|
this.state = {
|
||||||
width: 0
|
width: 0,
|
||||||
|
scrollRestored: false
|
||||||
};
|
};
|
||||||
|
|
||||||
this._grid = null;
|
this._grid = null;
|
||||||
|
@ -52,7 +53,8 @@ class VirtualTable extends Component {
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
const {
|
const {
|
||||||
width
|
width,
|
||||||
|
scrollRestored
|
||||||
} = this.state;
|
} = this.state;
|
||||||
|
|
||||||
if (this._grid &&
|
if (this._grid &&
|
||||||
|
@ -63,16 +65,17 @@ class VirtualTable extends Component {
|
||||||
this._grid.recomputeGridSize();
|
this._grid.recomputeGridSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this._grid && scrollTop !== undefined && scrollTop !== 0 && !scrollRestored) {
|
||||||
|
this.setState({ scrollRestored: true });
|
||||||
|
this._grid.scrollToPosition({ scrollTop });
|
||||||
|
}
|
||||||
|
|
||||||
if (scrollIndex != null && scrollIndex !== prevProps.scrollIndex) {
|
if (scrollIndex != null && scrollIndex !== prevProps.scrollIndex) {
|
||||||
this._grid.scrollToCell({
|
this._grid.scrollToCell({
|
||||||
rowIndex: scrollIndex,
|
rowIndex: scrollIndex,
|
||||||
columnIndex: 0
|
columnIndex: 0
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this._grid && scrollTop !== undefined && scrollTop !== 0) {
|
|
||||||
this._grid.scrollToPosition({ scrollTop });
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue