Directly call _setCurrentPageNumber when updating the Scroll/Spread modes in BaseViewer

Given that the `_updateScrollMode`/`_updateSpreadMode` methods are "private", there's no particular reason to not just directly call `_setCurrentPageNumber`.
This commit is contained in:
Jonas Jenwald 2018-11-09 10:16:40 +01:00
parent 2e38b7d00b
commit e16e072cb3

View File

@ -1086,7 +1086,7 @@ class BaseViewer {
if (this._currentScaleValue && isNaN(this._currentScaleValue)) {
this._setScale(this._currentScaleValue, true);
}
this.scrollPageIntoView({ pageNumber, });
this._setCurrentPageNumber(pageNumber, /* resetCurrentPageView = */ true);
this.update();
}
@ -1146,7 +1146,7 @@ class BaseViewer {
if (!pageNumber) {
return;
}
this.scrollPageIntoView({ pageNumber, });
this._setCurrentPageNumber(pageNumber, /* resetCurrentPageView = */ true);
this.update();
}
}