delay slide jumps a few ms
This commit is contained in:
parent
79e9fdf13f
commit
282680e163
2
dist/reveal.esm.js
vendored
2
dist/reveal.esm.js
vendored
File diff suppressed because one or more lines are too long
2
dist/reveal.esm.js.map
vendored
2
dist/reveal.esm.js.map
vendored
File diff suppressed because one or more lines are too long
2
dist/reveal.js
vendored
2
dist/reveal.js
vendored
File diff suppressed because one or more lines are too long
2
dist/reveal.js.map
vendored
2
dist/reveal.js.map
vendored
File diff suppressed because one or more lines are too long
@ -45,6 +45,9 @@ export default class JumpToSlide {
|
||||
if( this.isVisible() ) {
|
||||
this.element.remove();
|
||||
this.jumpInput.value = '';
|
||||
|
||||
clearTimeout( this.jumpTimeout );
|
||||
delete this.jumpTimeout;
|
||||
}
|
||||
|
||||
}
|
||||
@ -60,6 +63,9 @@ export default class JumpToSlide {
|
||||
*/
|
||||
jump() {
|
||||
|
||||
clearTimeout( this.jumpTimeout );
|
||||
delete this.jumpTimeout;
|
||||
|
||||
const value = this.jumpInput.value.trim( '' );
|
||||
const indices = this.Reveal.location.getIndicesFromHash( value );
|
||||
|
||||
@ -74,6 +80,13 @@ export default class JumpToSlide {
|
||||
|
||||
}
|
||||
|
||||
jumpAfter( delay ) {
|
||||
|
||||
clearTimeout( this.jumpTimeout );
|
||||
this.jumpTimeout = setTimeout( () => this.jump(), delay );
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverts back to the slide we were on when jump to slide was
|
||||
* invoked.
|
||||
@ -116,7 +129,7 @@ export default class JumpToSlide {
|
||||
|
||||
onInput( event ) {
|
||||
|
||||
this.jump();
|
||||
this.jumpAfter( 200 );
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user