fromthepage
fromthepage copied to clipboard
"Image at top" zoom doesn't fit across the screen
A transcriber says that the "image at top" layout doesn't make it easy for him to zoom in so that the image fits exactly across the screen. They added that it would be great if they could "stretch" the image so that it fits the screen and suggested adding a control to the toolbar, something like <->
They also added that when choosing to 'always show in full screen', it is not possible to navigate to the next page from the current one.
I had a quick glance across the OpenSeadragon docs. Turns out there's a convenient .fitHorizontally
method. I tested this and it does exactly what we would need here, i.e. stretch the image so that the width fills the window exactly.
I'm not sure where the icons are located in the codebase. But in principle, it would just be a matter of:
- Adding a suitable icon, mimicking the style of the current 'home' icon (cf. image above)
- Wiring up this icon with a simple JavaScript click handler (in the
_osd_div.html
template?) like so:
document.getElementById('fit-width-button').addEventListener('click', function() {
viewer.viewport.fitHorizontally();
});
If you point me to where the icons are, I can send a PR for this.