Inline the 'scalechanging' event dispatching in BaseViewer._setScaleUpdatePages
With only *one* event now being dispatched when the scale changes, in combination with there only being two call-sites, it doesn't seem necessary to keep the helper method for dispatching the 'scalechanging' event.
This commit is contained in:
parent
e2e9657ed0
commit
4b9d0a67d2
@ -538,20 +538,16 @@ class BaseViewer {
|
||||
throw new Error('Not implemented: _scrollIntoView');
|
||||
}
|
||||
|
||||
_setScaleDispatchEvent(newScale, newValue, preset = false) {
|
||||
this.eventBus.dispatch('scalechanging', {
|
||||
source: this,
|
||||
scale: newScale,
|
||||
presetValue: preset ? newValue : undefined,
|
||||
});
|
||||
}
|
||||
|
||||
_setScaleUpdatePages(newScale, newValue, noScroll = false, preset = false) {
|
||||
this._currentScaleValue = newValue.toString();
|
||||
|
||||
if (isSameScale(this._currentScale, newScale)) {
|
||||
if (preset) {
|
||||
this._setScaleDispatchEvent(newScale, newValue, true);
|
||||
this.eventBus.dispatch('scalechanging', {
|
||||
source: this,
|
||||
scale: newScale,
|
||||
presetValue: newValue,
|
||||
});
|
||||
}
|
||||
return;
|
||||
}
|
||||
@ -576,7 +572,11 @@ class BaseViewer {
|
||||
});
|
||||
}
|
||||
|
||||
this._setScaleDispatchEvent(newScale, newValue, preset);
|
||||
this.eventBus.dispatch('scalechanging', {
|
||||
source: this,
|
||||
scale: newScale,
|
||||
presetValue: preset ? newValue : undefined,
|
||||
});
|
||||
|
||||
if (this.defaultRenderingQueue) {
|
||||
this.update();
|
||||
|
Loading…
x
Reference in New Issue
Block a user