Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export class DownloadDialogue extends Dialogue<
);
this.$footer.append(this.$termsOfUseButton);

this.$termsOfUseButton.onPressed(() => {
this.onAccessibleClick(this.$termsOfUseButton, () => {
this.extensionHost.publish(IIIFEvents.SHOW_TERMS_OF_USE);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -423,15 +423,17 @@ export class BaseExtension<T extends BaseConfig> implements IExtension {
});

this.extensionHost.subscribe(IIIFEvents.SHOW_TERMS_OF_USE, () => {
let terms: string | null = this.helper.getLicense();
let terms: string | null = null;

if (!terms) {
const requiredStatement: ILabelValuePair | null =
this.helper.getRequiredStatement();
const requiredStatement: ILabelValuePair | null =
this.helper.getRequiredStatement();
if (requiredStatement?.value) {
terms = requiredStatement.value;
}

if (requiredStatement && requiredStatement.value) {
terms = requiredStatement.value;
}
if (!terms) {
const license = this.helper.getLicense();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe that getLicense can potentially return a null value, so we should only construct the link below if we have a non-null license.

terms = `<a href="${license}">${license}</a>`;
}

if (terms) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,9 @@
}

&.genericDialogue {
width: 250px;
width: fit-content;
min-width: 250px;
max-width: 400px;

.bottom {
background: none;
Expand Down