hacky fix for regression bug:
MODIFY
js/views/cfi_navigation_logic.js
js/views/cfi_navigation_logic.js
@@ -219,18 +219,22 @@ var CfiNavigationLogic = function(options) {
top: (options.paginationInfo ? options.paginationInfo.pageOffset : 0),
left: 0
};
- } else {
- return {
- top: 0,
- left: (options.paginationInfo ? options.paginationInfo.pageOffset : 0)
- //* (isPageProgressionRightToLeft() ? -1 : 1)
- };
}
+ // CAUSES REGRESSION BUGS !! TODO FIXME
+ // https://github.com/readium/readium-shared-js/issues/384#issuecomment-305145129
+ // else {
// return {
// top: 0,
- // left: 0
+ // left: (options.paginationInfo ? options.paginationInfo.pageOffset : 0)
+ // //* (isPageProgressionRightToLeft() ? -1 : 1)
// };
+ // }
+
+ return {
+ top: 0,
+ left: 0
+ };
}
/**
@@ -308,6 +312,26 @@ var CfiNavigationLogic = function(options) {
function findPageByRectangles($element, spatialVerticalOffset) {
var visibleContentOffsets = getVisibleContentOffsets();
+ //////////////////////
+ // ABOVE CAUSES REGRESSION BUGS !! TODO FIXME
+ // https://github.com/readium/readium-shared-js/issues/384#issuecomment-305145129
+ if (options.visibleContentOffsets) {
+ visibleContentOffsets = options.visibleContentOffsets();
+ }
+ if (isVerticalWritingMode()) {
+ visibleContentOffsets = {
+ top: (options.paginationInfo ? options.paginationInfo.pageOffset : 0),
+ left: 0
+ };
+ }
+ else { // THIS IS ENABLED ONLY FOR findPageByRectangles(), to fix the pageIndex computation. TODO FIXME!
+ visibleContentOffsets = {
+ top: 0,
+ left: (options.paginationInfo ? options.paginationInfo.pageOffset : 0)
+ //* (isPageProgressionRightToLeft() ? -1 : 1)
+ };
+ }
+ //////////////////////
var clientRectangles = getNormalizedRectangles($element, visibleContentOffsets);
if (clientRectangles.length === 0) { // elements with display:none, etc.

hacky fix for regression bug: https://github.com/readium/readium-shared-js/issues/384#issuecomment-305145129