mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 10:15:37 +02:00
Button widget annotations: implement support for pushbuttons
This commit is contained in:
parent
6f52fafdc0
commit
0fe80df2a7
6 changed files with 100 additions and 39 deletions
|
@ -61,8 +61,7 @@ class AnnotationElementFactory {
|
|||
} else if (parameters.data.checkBox) {
|
||||
return new CheckboxWidgetAnnotationElement(parameters);
|
||||
}
|
||||
warn('Unimplemented button widget annotation: pushbutton');
|
||||
break;
|
||||
return new PushButtonWidgetAnnotationElement(parameters);
|
||||
case 'Ch':
|
||||
return new ChoiceWidgetAnnotationElement(parameters);
|
||||
}
|
||||
|
@ -543,6 +542,25 @@ class RadioButtonWidgetAnnotationElement extends WidgetAnnotationElement {
|
|||
}
|
||||
}
|
||||
|
||||
class PushButtonWidgetAnnotationElement extends LinkAnnotationElement {
|
||||
/**
|
||||
* Render the push button widget annotation's HTML element
|
||||
* in the empty container.
|
||||
*
|
||||
* @public
|
||||
* @memberof PushButtonWidgetAnnotationElement
|
||||
* @returns {HTMLSectionElement}
|
||||
*/
|
||||
render() {
|
||||
// The rendering and functionality of a push button widget annotation is
|
||||
// equal to that of a link annotation, but may have more functionality, such
|
||||
// as performing actions on form fields (resetting, submitting, et cetera).
|
||||
let container = super.render();
|
||||
container.className = 'buttonWidgetAnnotation pushButton';
|
||||
return container;
|
||||
}
|
||||
}
|
||||
|
||||
class ChoiceWidgetAnnotationElement extends WidgetAnnotationElement {
|
||||
constructor(parameters) {
|
||||
super(parameters, parameters.renderInteractiveForms);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue