1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-19 06:38:07 +02:00

Merge pull request #19636 from calixteman/bug1952558

[Editor] Make sure the save checkbox isn't focusable when saving is disabled (bug 1952558)
This commit is contained in:
calixteman 2025-03-10 18:46:40 +01:00 committed by GitHub
commit febf59ce75
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 16 additions and 22 deletions

View file

@ -595,12 +595,16 @@
#addSignatureSaveContainer {
display: grid;
grid-template-columns: max-content max-content;
grid-template-columns: max-content auto;
gap: 4px;
width: 100%;
> input {
margin: 0;
&:disabled + label {
opacity: 0.4;
}
}
> label {
@ -617,14 +621,6 @@
color: var(--save-warning-color);
font-size: 11px;
}
&:is([disabled], .fullStorage) {
pointer-events: none;
> :not(#addSignatureSaveWarning) {
opacity: 0.4;
}
}
}
}
}

View file

@ -322,12 +322,10 @@ class SignatureManager {
}
#disableButtons(value) {
this.#clearButton.disabled = this.#addButton.disabled = !value;
if (value) {
this.#saveContainer.removeAttribute("disabled");
} else {
this.#saveContainer.setAttribute("disabled", true);
}
this.#saveCheckbox.disabled =
this.#clearButton.disabled =
this.#addButton.disabled =
!value;
}
#initTypeTab(reset) {

View file

@ -727,7 +727,7 @@ See https://github.com/adobe-type-tools/cmap-resources
<input id="addSignatureFilePicker" type="file"></input>
</div>
</div>
<div id="addSignatureControls" disabled>
<div id="addSignatureControls">
<div id="horizontalContainer">
<div id="addSignatureDescriptionContainer">
<label for="addSignatureDescription" data-l10n-id="pdfjs-editor-add-signature-description-label">Description (alt text)</span></label>
@ -739,7 +739,7 @@ See https://github.com/adobe-type-tools/cmap-resources
<button id="clearSignatureButton" type="button" data-l10n-id="pdfjs-editor-add-signature-clear-button" tabindex="0"><span data-l10n-id="pdfjs-editor-add-signature-clear-button-label">Clear signature</span></button>
</div>
<div id="addSignatureSaveContainer">
<input type="checkbox" id="addSignatureSaveCheckbox" checked="true" tabindex="0"></input>
<input type="checkbox" id="addSignatureSaveCheckbox" checked="true"></input>
<label for="addSignatureSaveCheckbox" data-l10n-id="pdfjs-editor-add-signature-save-checkbox">Save signature</label>
<span></span>
<span id="addSignatureSaveWarning" data-l10n-id="pdfjs-editor-add-signature-save-warning-message">Youve reached the limit of 5 saved signatures. Remove one to save more.</span>