Skip to content

Commit

Permalink
Disable the annotation button when anntoations are disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
lazka committed Jan 22, 2025
1 parent bca9679 commit 5213a13
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/dbp-signature-lit-element.js
Original file line number Diff line number Diff line change
Expand Up @@ -797,7 +797,7 @@ export default class DBPSignatureLitElement extends BaseLitElement {
}
}

getActionButtonsHtml(id) {
getActionButtonsHtml(id, annotations=true) {
const i18n = this._i18n;
const ICON_SIZE = '24px';

Expand Down Expand Up @@ -907,8 +907,9 @@ export default class DBPSignatureLitElement extends BaseLitElement {
annotationWrapper.appendChild(annotationBadge);
}

controlDiv.appendChild(annotationWrapper);

if (annotations) {
controlDiv.appendChild(annotationWrapper);
}

// Delete button
const btnDelete = document.createElement('dbp-icon-button');
Expand Down Expand Up @@ -1148,7 +1149,7 @@ export default class DBPSignatureLitElement extends BaseLitElement {
legend.append(legendDescription);
this._('.control.file-list').append(legend);
}
const actionButtons = this.getActionButtonsHtml(id);
const actionButtons = this.getActionButtonsHtml(id, this.allowAnnotating);
let fileData = {
index: id,
fileName: `${file.name} ${warning}`,
Expand Down

0 comments on commit 5213a13

Please sign in to comment.