Move the zoomIn/zoomOut functionality into BaseViewer (PR 14038 follow-up)

Given the simplicity of this functionality, we can move it from the default viewer and into the `BaseViewer` class instead. This way, it's possible to support more scripting functionality in the standalone viewer components; please see PR 14038.

Please note that I purposely went with `increaseScale`/`decreaseScale`-method names, rather than using "zoom", to better match the existing `currentScale`/`currentScaleValue` getters/setters that's being used in the `BaseViewer` class.
This commit is contained in:
Jonas Jenwald 2021-09-19 11:54:57 +02:00
parent 83d3bb43f4
commit d9f9fa4f1c
4 changed files with 39 additions and 21 deletions

View file

@ -324,13 +324,13 @@ class PDFScriptingManager {
if (isInPresentationMode) {
return;
}
this._eventBus.dispatch("zoomin", { source: this });
this._pdfViewer.increaseScale();
break;
case "ZoomViewOut":
if (isInPresentationMode) {
return;
}
this._eventBus.dispatch("zoomout", { source: this });
this._pdfViewer.decreaseScale();
break;
}
return;