Proper buffer for page and book modes (m2)

This commit is contained in:
Ian Gilman 2015-01-14 15:09:48 -08:00
parent 0c63f35de1
commit fe2aa52caf
2 changed files with 8 additions and 7 deletions

View File

@ -1,8 +1,8 @@
# To Do
* Make sure adjacent pages aren't visible
* Thumbs hover and active state (SVG overlay?)
* Resize on window resize
* When going to thumbs, scroll to the proper part of the page
* Show/hide pages?
* Support 400+ page collections
* Show/hide pages?
* Play with constraints while zooming out on corners/edges?

View File

@ -330,11 +330,12 @@
layoutConfig.sameWidth = true;
} else if (this.mode === 'scroll') {
layoutConfig.buffer = this.pageBuffer;
} else if (this.mode === 'book') {
layoutConfig.book = true;
layoutConfig.buffer = this.bigBuffer;
} else if (this.mode === 'page') {
layoutConfig.buffer = 2;
} else if (this.mode === 'book' || this.mode === 'page') {
layoutConfig.book = (this.mode === 'book');
var height = 1 + (this.pageBuffer * 2);
// Note that using window here is approximate, but that's close enough.
// We can't use viewer, because it may be stretched for the thumbs view.
layoutConfig.buffer = (height * ($(window).width() / $(window).height())) / 2;
}
var layout = {