mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 17:30:09 +02:00
JS -- Actions must be evaluated in global scope
* All the public properties of doc are injected into globalThis, in order to make them available through `this` * Put event in the global scope too.
This commit is contained in:
parent
c366390f6b
commit
167ff1a7fc
7 changed files with 178 additions and 53 deletions
|
@ -70,7 +70,7 @@ class EventDispatcher {
|
|||
|
||||
const name = baseEvent.name.replace(" ", "");
|
||||
const source = this._objects[id];
|
||||
const event = (this._document.obj._event = new Event(baseEvent));
|
||||
globalThis.event = new Event(baseEvent);
|
||||
let savedChange;
|
||||
|
||||
if (source.obj._isButton()) {
|
||||
|
@ -155,7 +155,7 @@ class EventDispatcher {
|
|||
}
|
||||
const first = this._calculationOrder[0];
|
||||
const source = this._objects[first];
|
||||
const event = (this._document.obj._event = new Event({}));
|
||||
globalThis.event = new Event({});
|
||||
this.runCalculate(source, event);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue