1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-22 16:18:08 +02:00

Button widget annotations: implement reference testing

Moreover, ensure that the read-only state is respected and improve CSS
names.
This commit is contained in:
Tim van der Meij 2016-12-15 22:15:38 +01:00
parent ba012c7a68
commit 0c9a06c020
6 changed files with 58 additions and 20 deletions

View file

@ -563,9 +563,10 @@ var CheckboxWidgetAnnotationElement =
* @returns {HTMLSectionElement}
*/
render: function CheckboxWidgetAnnotationElement_render() {
this.container.className = 'checkboxWidgetAnnotation';
this.container.className = 'buttonWidgetAnnotation checkBox';
var element = document.createElement('input');
element.disabled = this.data.readOnly;
element.type = 'checkbox';
element.id = this.data.fieldName;
if (this.data.fieldValue && this.data.fieldValue !== 'Off') {
@ -604,10 +605,11 @@ var RadioButtonWidgetAnnotationElement =
* @returns {HTMLSectionElement}
*/
render: function RadioButtonWidgetAnnotationElement_render() {
this.container.className = 'radioButtonWidgetAnnotation';
this.container.className = 'buttonWidgetAnnotation radioButton';
var element = document.createElement('input');
var id = this.data.fieldName + '.' + this.data.buttonValue;
element.disabled = this.data.readOnly;
element.type = 'radio';
element.id = id;
element.name = this.data.fieldName;