From e7211ba72ff52b80be742f195e0259ffd27c0aa9 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Tue, 23 Oct 2018 18:59:19 +0200 Subject: [PATCH] wip #2299 @1 --- js/libs/fluidbook/menu/fluidbook.index.js | 55 ++++++++++++++--------- style/fluidbook.less | 6 ++- 2 files changed, 39 insertions(+), 22 deletions(-) diff --git a/js/libs/fluidbook/menu/fluidbook.index.js b/js/libs/fluidbook/menu/fluidbook.index.js index b2b6f7ac..a2e92d7a 100644 --- a/js/libs/fluidbook/menu/fluidbook.index.js +++ b/js/libs/fluidbook/menu/fluidbook.index.js @@ -7,6 +7,7 @@ FluidbookIndex.prototype = { init: function () { this.normalHTML = ''; this.padHTML = ''; + this.singleMode = this.fluidbook.datas.mobileNavigationType === 'portrait'; }, getView: function (group) { @@ -29,19 +30,28 @@ FluidbookIndex.prototype = { var c = ''; var s1, s2; - for (var i = 0; i <= this.fluidbook.getMaxPage(); i += 2) { + var increment = this.singleMode ? 1 : 2; + var start = this.singleMode ? 1 : 0; + + for (var i = start; i <= this.fluidbook.getMaxPage(); i += increment) { var pages = []; j = i + 1; ix1 = ''; ix2 = ''; - c = ''; - if (this.fluidbook.l10n.dir == 'ltr') { - s1 = 'left'; - s2 = 'right' + if (this.singleMode) { + c = ' singlemode simple left '; + s2 = s1 = 'left'; } else { - s1 = 'right'; - s2 = 'left' + c = ''; + + if (this.fluidbook.l10n.dir == 'ltr') { + s1 = 'left'; + s2 = 'right' + } else { + s1 = 'right'; + s2 = 'left' + } } if (i > 0) { @@ -51,7 +61,6 @@ FluidbookIndex.prototype = { } pages.push(i); ix1 += ''; - } else { c = ' simple ' + s2; } @@ -64,22 +73,26 @@ FluidbookIndex.prototype = { s2 = 'left' } - if (j <= this.fluidbook.getMaxPage()) { - ix2 += '
' + this.fluidbook.loader.getThumbImage(j, null, true) + '' + this.fluidbook.physicalToVirtual(j) + ''; - if (this.fluidbook.bookmarks.enabled) { - ix2 += this.fluidbook.bookmarks.getBookmarkForPage(j, true); + if (!this.singleMode) { + if (j <= this.fluidbook.getMaxPage()) { + ix2 += '
' + this.fluidbook.loader.getThumbImage(j, null, true) + '' + this.fluidbook.physicalToVirtual(j) + ''; + if (this.fluidbook.bookmarks.enabled) { + ix2 += this.fluidbook.bookmarks.getBookmarkForPage(j, true); + } + ix2 += '
'; + pages.push(j); + } else { + c = ' simple ' + s2; } - ix2 += '
'; - pages.push(j); - } else { - c = ' simple ' + s2; - } - if (j == 1) { - pages.unshift(0); - } + if (j == 1) { + pages.unshift(0); + } - ix = ix1 + ix2; + ix = ix1 + ix2; + } else { + ix = ix1; + } this.normalHTML += '
' + ix; this.normalHTML += '
'; } diff --git a/style/fluidbook.less b/style/fluidbook.less index 38470236..d90583e1 100644 --- a/style/fluidbook.less +++ b/style/fluidbook.less @@ -1603,6 +1603,10 @@ form input[type="text"], form input[type="email"] { text-align: center; box-sizing: content-box; border-radius: 3px; + + &.singlemode { + width: 100px; + } } &.bookmarkView { @@ -2903,7 +2907,7 @@ body > input { 0% { margin-top: 0px; } - 100%{ + 100% { margin-top: -40px; } } -- 2.39.5