forked from EVOgeek/Vmeda.Online
		
	MOBILE-3814 collapsible: Animate collapse header end animation
This commit is contained in:
		
							parent
							
								
									ddd82378aa
								
							
						
					
					
						commit
						1c9f34b469
					
				| @ -378,7 +378,7 @@ export class CoreCollapsibleHeaderDirective implements OnInit, OnChanges, OnDest | |||||||
| 
 | 
 | ||||||
|             if (progress > 0 && progress < 1) { |             if (progress > 0 && progress < 1) { | ||||||
|                 // Finish opening or closing the bar.
 |                 // Finish opening or closing the bar.
 | ||||||
|                 this.endAnimationTimeout = window.setTimeout(() => this.endAnimation(progress), 500); |                 this.endAnimationTimeout = window.setTimeout(() => this.endAnimation(progress, contentScroll.scrollTop), 500); | ||||||
|             } |             } | ||||||
|         }); |         }); | ||||||
|     } |     } | ||||||
| @ -387,8 +387,9 @@ export class CoreCollapsibleHeaderDirective implements OnInit, OnChanges, OnDest | |||||||
|      * End of animation when stop scrolling. |      * End of animation when stop scrolling. | ||||||
|      * |      * | ||||||
|      * @param progress Progress. |      * @param progress Progress. | ||||||
|  |      * @param scrollTop Current ScrollTop position. | ||||||
|      */ |      */ | ||||||
|     protected endAnimation(progress: number): void { |     protected endAnimation(progress: number, scrollTop: number): void { | ||||||
|         if(!this.page) { |         if(!this.page) { | ||||||
|             return; |             return; | ||||||
|         } |         } | ||||||
| @ -397,6 +398,14 @@ export class CoreCollapsibleHeaderDirective implements OnInit, OnChanges, OnDest | |||||||
| 
 | 
 | ||||||
|         this.page.style.setProperty('--collapsible-header-progress', collapse ? '1' : '0'); |         this.page.style.setProperty('--collapsible-header-progress', collapse ? '1' : '0'); | ||||||
|         this.page.classList.toggle('is-collapsed', collapse); |         this.page.classList.toggle('is-collapsed', collapse); | ||||||
|  | 
 | ||||||
|  |         if (collapse && this.scrollingHeight && this.scrollingHeight > 0 && scrollTop < this.scrollingHeight) { | ||||||
|  |             this.content?.scrollToPoint(null, this.scrollingHeight); | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         if (!collapse && this.scrollingHeight && this.scrollingHeight > 0 && scrollTop > 0) { | ||||||
|  |             this.content?.scrollToPoint(null, 0); | ||||||
|  |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
| } | } | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user