@@ -76,62 +76,6 @@ BlazeComponent.extendComponent({
7676 return ! Utils . getPopupCardId ( ) && ReactiveCache . getCurrentUser ( ) . hasCardMaximized ( ) ;
7777 } ,
7878
79- scrollParentContainer ( ) {
80- const cardPanelWidth = 600 ;
81- const parentComponent = this . parentComponent ( ) ;
82-
83- /*
84- // Incomplete fix about bug where opening card scrolls to wrong place
85- // https://github.com/wekan/wekan/issues/4572#issuecomment-1184149395
86- // TODO sometimes parentComponent is not available, maybe because it's not
87- // yet created?!
88- if (!parentComponent) return;
89- const bodyBoardComponent = parentComponent.parentComponent();
90- */
91-
92- //On Mobile View Parent is Board, Not Board Body. I cant see how this funciton should work then.
93- if ( bodyBoardComponent === null ) return ;
94- const $cardView = this . $ ( this . firstNode ( ) ) ;
95- const $cardContainer = bodyBoardComponent . $ ( '.js-swimlanes' ) ;
96-
97- /*
98- // Incomplete fix about bug where opening card scrolls to wrong place
99- // https://github.com/wekan/wekan/issues/4572#issuecomment-1184149395
100- // TODO sometimes cardContainer is not available, maybe because it's not yet
101- // created?!
102- if (!$cardContainer) return;
103- */
104-
105- const cardContainerScroll = $cardContainer . scrollLeft ( ) ;
106- const cardContainerWidth = $cardContainer . width ( ) ;
107-
108- const cardViewStart = $cardView . offset ( ) . left ;
109- const cardViewEnd = cardViewStart + cardPanelWidth ;
110-
111- let offset = false ;
112- if ( cardViewStart < 0 ) {
113- offset = cardViewStart ;
114- } else if ( cardViewEnd > cardContainerWidth ) {
115- offset = cardViewEnd - cardContainerWidth ;
116- }
117-
118- if ( offset ) {
119- bodyBoardComponent . scrollLeft ( cardContainerScroll + offset ) ;
120- }
121-
122- //Scroll top
123- const cardViewStartTop = $cardView . offset ( ) . top ;
124- const cardContainerScrollTop = $cardContainer . scrollTop ( ) ;
125-
126- let topOffset = false ;
127- if ( cardViewStartTop !== 100 ) {
128- topOffset = cardViewStartTop - 100 ;
129- }
130- if ( topOffset !== false ) {
131- bodyBoardComponent . scrollTop ( cardContainerScrollTop + topOffset ) ;
132- }
133- } ,
134-
13579 presentParentTask ( ) {
13680 let result = this . currentBoard . presentParentTask ;
13781 if ( result === null || result === undefined ) {
@@ -442,20 +386,10 @@ BlazeComponent.extendComponent({
442386 'click .js-maximize-card-details' ( ) {
443387 Meteor . call ( 'toggleCardMaximized' ) ;
444388 autosize ( $ ( '.card-details' ) ) ;
445- if ( ! Utils . isMiniScreen ( ) ) {
446- Meteor . setTimeout ( ( ) => {
447- this . scrollParentContainer ( ) ;
448- } , 500 ) ;
449- }
450389 } ,
451390 'click .js-minimize-card-details' ( ) {
452391 Meteor . call ( 'toggleCardMaximized' ) ;
453392 autosize ( $ ( '.card-details' ) ) ;
454- if ( ! Utils . isMiniScreen ( ) ) {
455- Meteor . setTimeout ( ( ) => {
456- this . scrollParentContainer ( ) ;
457- } , 500 ) ;
458- }
459393 } ,
460394 'click .js-vote' ( e ) {
461395 const forIt = $ ( e . target ) . hasClass ( 'js-vote-positive' ) ;
0 commit comments