Skip to content
Snippets Groups Projects
Unverified Commit 72a5d9e9 authored by Jack Reed's avatar Jack Reed Committed by GitHub
Browse files

Merge pull request #2213 from ProjectMirador/2212-truncate-osd-info

Fix truncating viewer info; fixes #2212
parents 3cc6f90e 50b7ad1c
No related branches found
No related tags found
No related merge requests found
......@@ -21,8 +21,11 @@ describe('ViewerNavigation', () => {
it('renders the component', () => {
wrapper = createWrapper();
expect(wrapper.find(Typography).length).toBe(1);
expect(wrapper.find(Typography).length).toBe(2);
expect(wrapper.find(Typography).at(0)
.matchesElement(<Typography>3 of 8 testLabel</Typography>)).toBe(true);
.matchesElement(<Typography>3 of 8</Typography>)).toBe(true);
expect(wrapper.find(Typography).at(1)
.matchesElement(<Typography> testLabel</Typography>)).toBe(true);
});
});
......@@ -18,9 +18,11 @@ export class ViewerInfo extends Component {
return (
<div className={ns('osd-info')}>
<Typography variant="caption" className={ns('canvas-label')}>
<Typography inline variant="caption" className={ns('canvas-count')}>
{`${canvasIndex + 1} ${t('of')} ${canvasCount}`}
{canvasLabel && ` ${String.fromCharCode(8226)} ${canvasLabel}`}
</Typography>
<Typography inline variant="caption" className={ns('canvas-label')}>
{canvasLabel && ` • ${canvasLabel}`}
</Typography>
</div>
);
......
......@@ -124,7 +124,12 @@
}
&-osd-info {
order: 2
order: 2;
overflow: hidden;
padding-bottom: 3px;
text-overflow: ellipsis;
white-space: nowrap;
width: 100%;
}
&-canvas-nav {
......@@ -135,12 +140,6 @@
text-align: center;
}
&-canvas-label {
width: 100%;
text-overflow: ellipsis;
padding-bottom: 3px;
}
&-thumb-navigation {
.mirador-thumbnail-nav-canvas {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment