mirror of
https://github.com/Lightcord/Lightcord.git
synced 2025-04-12 00:55:40 +02:00
Fix scrollTop error in addon settings.
This commit is contained in:
parent
02cd8c4c30
commit
cc7ff4a030
File diff suppressed because one or more lines are too long
2
BetterDiscordApp/js/main.min.js
vendored
2
BetterDiscordApp/js/main.min.js
vendored
File diff suppressed because one or more lines are too long
@ -59,6 +59,10 @@ export default class V2C_PluginCard extends BDV2.reactComponent {
|
|||||||
if (!settingsCookie["fork-ps-3"]) return;
|
if (!settingsCookie["fork-ps-3"]) return;
|
||||||
setImmediate(() => {
|
setImmediate(() => {
|
||||||
const isHidden = (container, element) => {
|
const isHidden = (container, element) => {
|
||||||
|
if(!container){
|
||||||
|
console.error(new Error(`Container is undefined.`))
|
||||||
|
return false
|
||||||
|
}
|
||||||
const cTop = container.scrollTop;
|
const cTop = container.scrollTop;
|
||||||
const cBottom = cTop + container.clientHeight;
|
const cBottom = cTop + container.clientHeight;
|
||||||
const eTop = element.offsetTop;
|
const eTop = element.offsetTop;
|
||||||
@ -67,7 +71,7 @@ export default class V2C_PluginCard extends BDV2.reactComponent {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const thisNode = this.refs.cardNode;
|
const thisNode = this.refs.cardNode;
|
||||||
const container = thisNode.closest("div[class*=\"scroller-\"]")
|
const container = thisNode.closest("div[class*=\"contentRegionScroller-\"]")
|
||||||
if (!isHidden(container, thisNode)) return;
|
if (!isHidden(container, thisNode)) return;
|
||||||
const thisNodeOffset = DOM.offset(thisNode);
|
const thisNodeOffset = DOM.offset(thisNode);
|
||||||
const containerOffset = DOM.offset(container);
|
const containerOffset = DOM.offset(container);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user