Merge pull request #9356 from Snuffleupagus/PDFHistory-maxUid-pageHide-fixes
Two small `PDFHistory` fixes, concerning the `this._maxUid` property and the 'pagehide' event
This commit is contained in:
commit
ba0a3aebd0
@ -133,6 +133,9 @@ class PDFHistory {
|
|||||||
let destination = state.destination;
|
let destination = state.destination;
|
||||||
this._updateInternalState(destination, state.uid,
|
this._updateInternalState(destination, state.uid,
|
||||||
/* removeTemporary = */ true);
|
/* removeTemporary = */ true);
|
||||||
|
if (this._uid > this._maxUid) {
|
||||||
|
this._maxUid = this._uid;
|
||||||
|
}
|
||||||
|
|
||||||
if (destination.rotation !== undefined) {
|
if (destination.rotation !== undefined) {
|
||||||
this.initialRotation = destination.rotation;
|
this.initialRotation = destination.rotation;
|
||||||
@ -510,6 +513,9 @@ class PDFHistory {
|
|||||||
let destination = state.destination;
|
let destination = state.destination;
|
||||||
this._updateInternalState(destination, state.uid,
|
this._updateInternalState(destination, state.uid,
|
||||||
/* removeTemporary = */ true);
|
/* removeTemporary = */ true);
|
||||||
|
if (this._uid > this._maxUid) {
|
||||||
|
this._maxUid = this._uid;
|
||||||
|
}
|
||||||
|
|
||||||
if (isValidRotation(destination.rotation)) {
|
if (isValidRotation(destination.rotation)) {
|
||||||
this.linkService.rotation = destination.rotation;
|
this.linkService.rotation = destination.rotation;
|
||||||
@ -541,10 +547,10 @@ class PDFHistory {
|
|||||||
_boundEvents.pageHide = (evt) => {
|
_boundEvents.pageHide = (evt) => {
|
||||||
// Attempt to push the `this._position` into the browser history when
|
// Attempt to push the `this._position` into the browser history when
|
||||||
// navigating away from the document. This is *only* done if the history
|
// navigating away from the document. This is *only* done if the history
|
||||||
// is currently empty, since otherwise an existing browser history entry
|
// is empty/temporary, since otherwise an existing browser history entry
|
||||||
// will end up being overwritten (given that new entries cannot be pushed
|
// will end up being overwritten (given that new entries cannot be pushed
|
||||||
// into the browser history when the 'unload' event has already fired).
|
// into the browser history when the 'unload' event has already fired).
|
||||||
if (!this._destination) {
|
if (!this._destination || this._destination.temporary) {
|
||||||
this._tryPushCurrentPosition();
|
this._tryPushCurrentPosition();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user