mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 01:10:08 +02:00
Use the new "reporttelemetry" event in more viewer components
By utilizing the recently added "reporttelemetry" event, we can avoid having to manually pass in `externalServices` to a number of viewer components.
This commit is contained in:
parent
f2d75d9221
commit
fe60db27b1
3 changed files with 16 additions and 18 deletions
|
@ -56,7 +56,7 @@ class SecondaryToolbar {
|
|||
* @param {SecondaryToolbarOptions} options
|
||||
* @param {EventBus} eventBus
|
||||
*/
|
||||
constructor(options, eventBus, externalServices) {
|
||||
constructor(options, eventBus) {
|
||||
this.toolbar = options.toolbar;
|
||||
this.toggleButton = options.toggleButton;
|
||||
this.buttons = [
|
||||
|
@ -155,7 +155,6 @@ class SecondaryToolbar {
|
|||
};
|
||||
|
||||
this.eventBus = eventBus;
|
||||
this.externalServices = externalServices;
|
||||
this.opened = false;
|
||||
|
||||
// Bind the event listeners for click, cursor tool, and scroll/spread mode
|
||||
|
@ -214,9 +213,12 @@ class SecondaryToolbar {
|
|||
if (close) {
|
||||
this.close();
|
||||
}
|
||||
this.externalServices.reportTelemetry({
|
||||
type: "buttons",
|
||||
data: { id: element.id },
|
||||
this.eventBus.dispatch("reporttelemetry", {
|
||||
source: this,
|
||||
details: {
|
||||
type: "buttons",
|
||||
data: { id: element.id },
|
||||
},
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue