mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 01:10:08 +02:00
[api-minor] Remove the getGlobalEventBus
viewer functionality (PR 11631 follow-up)
The correct/intended way of working with the "viewer components" is by providing an `EventBus` instance upon initialization, and the `getGlobalEventBus` was only added for backwards compatibility. Note, for example, that using `getGlobalEventBus` doesn't really work at all well with a use-case where there's *multiple* `PDFViewer` instances on a one page, since it may then be difficult/impossible to tell which viewer a particular event originated from. All of the "viewer components" examples have been previously updated, such that there's no longer any code/examples which relies on the now removed `getGlobalEventBus` functionality.
This commit is contained in:
parent
c12ea21c14
commit
7fd5f2dd61
8 changed files with 10 additions and 26 deletions
|
@ -13,7 +13,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { getGlobalEventBus, parseQueryString } from "./ui_utils.js";
|
||||
import { parseQueryString } from "./ui_utils.js";
|
||||
|
||||
/**
|
||||
* @typedef {Object} PDFLinkServiceOptions
|
||||
|
@ -44,7 +44,7 @@ class PDFLinkService {
|
|||
externalLinkEnabled = true,
|
||||
ignoreDestinationZoom = false,
|
||||
} = {}) {
|
||||
this.eventBus = eventBus || getGlobalEventBus();
|
||||
this.eventBus = eventBus;
|
||||
this.externalLinkTarget = externalLinkTarget;
|
||||
this.externalLinkRel = externalLinkRel;
|
||||
this.externalLinkEnabled = externalLinkEnabled;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue