Ensure that the PDFHistory._updateViewareaTimeout
is always reset when the history is updated
This commit is contained in:
parent
9b14f8ea2a
commit
077195d8ce
@ -358,6 +358,13 @@ class PDFHistory {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
_updateInternalState(destination, uid, removeTemporary = false) {
|
_updateInternalState(destination, uid, removeTemporary = false) {
|
||||||
|
if (this._updateViewareaTimeout) {
|
||||||
|
// When updating `this._destination`, make sure that we always wait for
|
||||||
|
// the next 'updateviewarea' event before (potentially) attempting to
|
||||||
|
// push the current position to the browser history.
|
||||||
|
clearTimeout(this._updateViewareaTimeout);
|
||||||
|
this._updateViewareaTimeout = null;
|
||||||
|
}
|
||||||
if (removeTemporary && destination && destination.temporary) {
|
if (removeTemporary && destination && destination.temporary) {
|
||||||
// When the `destination` comes from the browser history,
|
// When the `destination` comes from the browser history,
|
||||||
// we no longer treat it as a *temporary* position.
|
// we no longer treat it as a *temporary* position.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user