mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 01:10:08 +02:00
[Editor] Add the telemetry for the new alt text (bug 1912500)
This commit is contained in:
parent
4367fc1bc0
commit
00305184b5
5 changed files with 144 additions and 27 deletions
|
@ -112,6 +112,10 @@ class Toolbar {
|
|||
: AnnotationEditorType.STAMP;
|
||||
},
|
||||
},
|
||||
telemetry: {
|
||||
type: "editing",
|
||||
data: { action: "pdfjs.image.icon_click" },
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
|
@ -173,7 +177,7 @@ class Toolbar {
|
|||
const self = this;
|
||||
|
||||
// The buttons within the toolbar.
|
||||
for (const { element, eventName, eventDetails } of buttons) {
|
||||
for (const { element, eventName, eventDetails, telemetry } of buttons) {
|
||||
element.addEventListener("click", evt => {
|
||||
if (eventName !== null) {
|
||||
eventBus.dispatch(eventName, {
|
||||
|
@ -183,6 +187,12 @@ class Toolbar {
|
|||
isFromKeyboard: evt.detail === 0,
|
||||
});
|
||||
}
|
||||
if (telemetry) {
|
||||
eventBus.dispatch("reporttelemetry", {
|
||||
source: this,
|
||||
details: telemetry,
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
// The non-button elements within the toolbar.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue