Skip to content

Commit

Permalink
fix buttons disabled state when pdf-viewer is open
Browse files Browse the repository at this point in the history
  • Loading branch information
zsuffad committed Nov 6, 2024
1 parent 20a559b commit 87b9fb5
Showing 1 changed file with 21 additions and 9 deletions.
30 changes: 21 additions & 9 deletions src/dbp-qualified-signature-pdf-upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,6 @@ class QualifiedSignaturePdfUpload extends ScopedElementsMixin(DBPSignatureLitEle
const file = this.queuedFiles[key].file;
const fileName = file.name;
// Some have a signature but are not "manual", stop everything
// @TODO add all files that needs signature placement
notify({
summary: fileName,
body: i18n.t('error-manual-positioning-missing'),
Expand Down Expand Up @@ -630,6 +629,7 @@ class QualifiedSignaturePdfUpload extends ScopedElementsMixin(DBPSignatureLitEle
field: 'warning',
sorter: false,
minWidth: 140,
widthGrow: 2,
hozAlign: 'left',
headerHozAlign: 'center',
formatter: 'html',
Expand Down Expand Up @@ -920,8 +920,11 @@ class QualifiedSignaturePdfUpload extends ScopedElementsMixin(DBPSignatureLitEle
<div class="control field tabulator-actions">
<div class="table-actions">
<dbp-loading-button id="expand-all-btn"
class="${classMap({hidden: this.queuedFilesTableExpanded})}"
?disabled="${this.queuedFilesCount === 0 || this.queuedFilesTableCollapsible === false}"
class="${classMap({
hidden: this.queuedFilesTableExpanded,
'is-disabled': this.isUserInterfaceDisabled()
})}"
?disabled="${this.queuedFilesCount === 0 || this.queuedFilesTableCollapsible === false || this.isUserInterfaceDisabled()}"
value="${i18n.t('qualified-pdf-upload.expand-all')}"
@click="${() => {
this.tableQueuedFilesTable.expandAll();
Expand All @@ -931,8 +934,11 @@ class QualifiedSignaturePdfUpload extends ScopedElementsMixin(DBPSignatureLitEle
>${i18n.t('qualified-pdf-upload.expand-all')}</dbp-loading-button>
<dbp-loading-button id="collapse-all-btn"
class="${classMap({hidden: !this.queuedFilesTableExpanded})}"
?disabled="${this.queuedFilesCount === 0 || this.queuedFilesTableCollapsible === false}"
class="${classMap({
hidden: !this.queuedFilesTableExpanded,
'is-disabled': this.isUserInterfaceDisabled()
})}"
?disabled="${this.queuedFilesCount === 0 || this.queuedFilesTableCollapsible === false || this.isUserInterfaceDisabled()}"
value="${i18n.t('qualified-pdf-upload.collapse-all')}"
@click="${() => {
this.tableQueuedFilesTable.collapseAll();
Expand All @@ -942,8 +948,11 @@ class QualifiedSignaturePdfUpload extends ScopedElementsMixin(DBPSignatureLitEle
>${i18n.t('qualified-pdf-upload.collapse-all')}</dbp-loading-button>
<dbp-loading-button id="select-all-btn"
class="${classMap({hidden: this.queuedFilesTableAllSelected})}"
?disabled="${this.queuedFilesCount === 0}"
class="${classMap({
hidden: this.queuedFilesTableAllSelected,
'is-disabled': this.isUserInterfaceDisabled()
})}"
?disabled="${this.queuedFilesCount === 0 || this.isUserInterfaceDisabled()}"
value="${i18n.t('qualified-pdf-upload.select-all')}"
@click="${() => {
this.queuedFilesTableAllSelected = true;
Expand All @@ -953,8 +962,11 @@ class QualifiedSignaturePdfUpload extends ScopedElementsMixin(DBPSignatureLitEle
>${i18n.t('qualified-pdf-upload.select-all')}</dbp-loading-button>
<dbp-loading-button id="deselect-all-btn"
class="${classMap({hidden: !this.queuedFilesTableAllSelected})}"
?disabled="${this.queuedFilesCount === 0}"
class="${classMap({
hidden: !this.queuedFilesTableAllSelected,
'is-disabled': this.isUserInterfaceDisabled()
})}"
?disabled="${this.queuedFilesCount === 0 || this.isUserInterfaceDisabled()}"
value="${i18n.t('qualified-pdf-upload.deselect-all')}"
@click="${() => {
this.queuedFilesTableAllSelected = false;
Expand Down

0 comments on commit 87b9fb5

Please sign in to comment.