1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-26 10:08:06 +02:00

Merge pull request #12333 from calixteman/tooltip

Add tooltip if any in annotations layer
This commit is contained in:
Tim van der Meij 2020-10-03 19:50:39 +02:00 committed by GitHub
commit 6ff1fe4ea9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 61 additions and 3 deletions

View file

@ -1533,6 +1533,7 @@ class ButtonWidgetAnnotation extends WidgetAnnotation {
this.hasFieldFlag(AnnotationFieldFlag.RADIO) &&
!this.hasFieldFlag(AnnotationFieldFlag.PUSHBUTTON);
this.data.pushButton = this.hasFieldFlag(AnnotationFieldFlag.PUSHBUTTON);
this.data.isTooltipOnly = false;
if (this.data.checkBox) {
this._processCheckBox(params);
@ -1780,11 +1781,13 @@ class ButtonWidgetAnnotation extends WidgetAnnotation {
}
_processPushButton(params) {
if (!params.dict.has("A")) {
if (!params.dict.has("A") && !this.data.alternativeText) {
warn("Push buttons without action dictionaries are not supported");
return;
}
this.data.isTooltipOnly = !params.dict.has("A");
Catalog.parseDestDictionary({
destDict: params.dict,
resultObj: this.data,