Browse Source

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

Jonas Jenwald 8 years ago
parent
commit
077195d8ce
  1. 7
      web/pdf_history.js

7
web/pdf_history.js

@ -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…
Cancel
Save