Reverted incomplete fix about bug where opening card scrolls to wrong place.

Thanks to danceb, DimDz, mfilser, Emile840, derbolle, xplodwild and xet7 !

Fixes #4572
This commit is contained in:
Lauri Ojansivu 2022-07-29 13:10:51 -04:00
parent 36ae118afc
commit 6594795f39

View file

@ -86,17 +86,29 @@ BlazeComponent.extendComponent({
scrollParentContainer() {
const cardPanelWidth = 600;
const parentComponent = this.parentComponent();
/*
// Incomplete fix about bug where opening card scrolls to wrong place
// https://github.com/wekan/wekan/issues/4572#issuecomment-1184149395
// TODO sometimes parentComponent is not available, maybe because it's not
// yet created?!
if (!parentComponent) return;
const bodyBoardComponent = parentComponent.parentComponent();
*/
//On Mobile View Parent is Board, Not Board Body. I cant see how this funciton should work then.
if (bodyBoardComponent === null) return;
const $cardView = this.$(this.firstNode());
const $cardContainer = bodyBoardComponent.$('.js-swimlanes');
/*
// Incomplete fix about bug where opening card scrolls to wrong place
// https://github.com/wekan/wekan/issues/4572#issuecomment-1184149395
// TODO sometimes cardContainer is not available, maybe because it's not yet
// created?!
if (!$cardContainer) return;
*/
const cardContainerScroll = $cardContainer.scrollLeft();
const cardContainerWidth = $cardContainer.width();