Ensure that the PDFHistory._updateViewareaTimeout is always reset when the history is updated

This commit is contained in:
Jonas Jenwald 2017-09-07 11:37:23 +02:00
parent 9b14f8ea2a
commit 077195d8ce

View File

@ -358,6 +358,13 @@ class PDFHistory {
* @private
*/
_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) {
// When the `destination` comes from the browser history,
// we no longer treat it as a *temporary* position.