forked from CIT/Vmeda.Online
		
	MOBILE-4081 swipe-slides: Book chapter tags not always shown
This commit is contained in:
		
							parent
							
								
									3fa72b3a36
								
							
						
					
					
						commit
						c6f48336fc
					
				@ -64,6 +64,8 @@ export class AddonModBookContentsPage implements OnInit, OnDestroy {
 | 
			
		||||
    navigationItems: CoreNavigationBarItem<AddonModBookTocChapter>[] = [];
 | 
			
		||||
    slidesOpts: CoreSwipeSlidesOptions = {
 | 
			
		||||
        autoHeight: true,
 | 
			
		||||
        observer: true,
 | 
			
		||||
        observeParents: true,
 | 
			
		||||
        scrollOnChange: 'top',
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -46,7 +46,6 @@ export class CoreSwipeSlidesComponent<Item = unknown> implements OnChanges, OnDe
 | 
			
		||||
    protected resizeListener: CoreEventObserver;
 | 
			
		||||
    protected updateSlidesPromise?: Promise<void>;
 | 
			
		||||
    protected activeSlideIndexes: number[] = [];
 | 
			
		||||
    protected mutationObserver: MutationObserver;
 | 
			
		||||
 | 
			
		||||
    constructor(
 | 
			
		||||
        elementRef: ElementRef<HTMLElement>,
 | 
			
		||||
@ -57,14 +56,6 @@ export class CoreSwipeSlidesComponent<Item = unknown> implements OnChanges, OnDe
 | 
			
		||||
        this.resizeListener = CoreDom.onWindowResize(async () => {
 | 
			
		||||
            await this.updateSlidesComponent();
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
        this.mutationObserver = new MutationObserver(() => {
 | 
			
		||||
            setTimeout(async () => {
 | 
			
		||||
                await this.updateSlidesComponent();
 | 
			
		||||
            }, 100);
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
        this.mutationObserver.observe(this.hostElement, { subtree: true, childList: true });
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
@ -321,7 +312,6 @@ export class CoreSwipeSlidesComponent<Item = unknown> implements OnChanges, OnDe
 | 
			
		||||
    ngOnDestroy(): void {
 | 
			
		||||
        this.unsubscribe && this.unsubscribe();
 | 
			
		||||
        this.resizeListener.off();
 | 
			
		||||
        this.mutationObserver.disconnect();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user