Remove the attachDOMEventsToEventBus functionality, since EventBus instances are able to re-dispatch events to the DOM (PR 10019, bug 1492849 follow-up)

This also removes the old 'pagechange'/'scalechange'/'documentload' events.
This commit is contained in:
Jonas Jenwald 2018-09-20 20:51:50 +02:00
parent 7053b5a146
commit e2e9657ed0
15 changed files with 41 additions and 188 deletions

View file

@ -732,9 +732,6 @@ class EventBus {
* @private
*/
_dispatchDOMEvent(eventName, args = null) {
if (!this._dispatchToDOM) {
return;
}
const details = Object.create(null);
if (args && args.length > 0) {
const obj = args[0];
@ -755,6 +752,14 @@ class EventBus {
}
}
let globalEventBus = null;
function getGlobalEventBus(dispatchToDOM = false) {
if (!globalEventBus) {
globalEventBus = new EventBus({ dispatchToDOM, });
}
return globalEventBus;
}
function clamp(v, min, max) {
return Math.min(Math.max(v, min), max);
}
@ -868,6 +873,7 @@ export {
TextLayerMode,
NullL10n,
EventBus,
getGlobalEventBus,
ProgressBar,
getPDFFileNameFromURL,
noContextMenuHandler,