mirror of
				https://github.com/Redocly/redoc.git
				synced 2025-11-04 01:37:32 +03:00 
			
		
		
		
	fix: resolve menu synchronization issue (use proper throttle)
This commit is contained in:
		
							parent
							
								
									29207cf0d2
								
							
						
					
					
						commit
						84d1c7b2f2
					
				| 
						 | 
					@ -1,7 +1,7 @@
 | 
				
			||||||
import { bind, debounce } from 'decko';
 | 
					import { bind } from 'decko';
 | 
				
			||||||
import { EventEmitter } from 'eventemitter3';
 | 
					import { EventEmitter } from 'eventemitter3';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import { isBrowser, querySelector } from '../utils';
 | 
					import { isBrowser, querySelector, Throttle } from '../utils';
 | 
				
			||||||
import { RedocNormalizedOptions } from './RedocNormalizedOptions';
 | 
					import { RedocNormalizedOptions } from './RedocNormalizedOptions';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const EVENT = 'scroll';
 | 
					const EVENT = 'scroll';
 | 
				
			||||||
| 
						 | 
					@ -75,7 +75,7 @@ export class ScrollService {
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  @bind
 | 
					  @bind
 | 
				
			||||||
  @debounce(100)
 | 
					  @Throttle(100)
 | 
				
			||||||
  handleScroll() {
 | 
					  handleScroll() {
 | 
				
			||||||
    const scrollY = this.scrollY();
 | 
					    const scrollY = this.scrollY();
 | 
				
			||||||
    const isScrolledDown = scrollY - this._prevOffsetY > 0;
 | 
					    const isScrolledDown = scrollY - this._prevOffsetY > 0;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -6,3 +6,4 @@ export * from './helpers';
 | 
				
			||||||
export * from './highlight';
 | 
					export * from './highlight';
 | 
				
			||||||
export * from './loadAndBundleSpec';
 | 
					export * from './loadAndBundleSpec';
 | 
				
			||||||
export * from './dom';
 | 
					export * from './dom';
 | 
				
			||||||
 | 
					export * from './decorators';
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user