Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(still-image): IIIF URL copy button (DEV-524) #690

Merged
merged 3 commits into from Mar 22, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -6,7 +6,15 @@
<span class="caption mat-caption">{{imageCaption}}</span>
</div>
<div class="bottom">
<a href="{{iiifUrl}}" target="_blank" class="iiif mat-caption">{{iiifUrl}}</a>
<div class="iiif-link">
<a href="{{iiifUrl}}" target="_blank" class="mat-caption">{{iiifUrl}}</a>
</div>
<div class="copy-button">
<button mat-icon-button matTooltip="Copy IIIF URL" [cdkCopyToClipboard]="iiifUrl">
<mat-icon>content_copy</mat-icon>
</button>
</div>

</div>
</div>
<!-- caption -->
Expand Down
Expand Up @@ -32,12 +32,25 @@ $bright: #ccc;
.captions-container {
.top, .bottom {
text-align: left;
.iiif {
padding: 0px 0px 0px 16px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 50%;
.iiif-link, .copy-button {
display: inline-block;
}
.iiif-link {
a {
padding: 0px 0px 0px 16px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 50%;
}
}
.copy-button button {
background: none;
border: none;
color: white;
mat-icon {
font-size: 16px;
}
}
}
}
Expand Down
Expand Up @@ -188,7 +188,7 @@ describe('StillImageComponent', () => {
const hostCompDe = testHostFixture.debugElement;
const stillImageComponentDe = hostCompDe.query(By.directive(StillImageComponent));

const iiifUrlDebugElement = stillImageComponentDe.query(By.css('.iiif'));
const iiifUrlDebugElement = stillImageComponentDe.query(By.css('.iiif-link a'));
const iiifUrlEle = iiifUrlDebugElement.nativeElement;

expect(iiifUrlEle.innerText).toEqual('https://iiif.test.dasch.swiss:443/0803/incunabula_0000003840.jp2/full/3210,5144/0/default.jpg');
Expand Down
2 changes: 1 addition & 1 deletion src/assets/style/_elements.scss
Expand Up @@ -331,7 +331,7 @@ a,
}

&.horizontal {
height: $panel-height;
height: auto;
width: 100%;
left: 0;
flex-direction: row;
Expand Down