From: Vincent Vanwaelscappel Date: Fri, 16 Aug 2013 09:40:27 +0000 (+0000) Subject: (no commit message) X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=53c7d41740ac6a4d67b00ef02f5c1a8ab37605b1;p=fluidbook-html5.git --- diff --git a/js/libs/fluidbook/views/fluidbook.chapters.js b/js/libs/fluidbook/views/fluidbook.chapters.js index 21ef909e..e6f7c01a 100644 --- a/js/libs/fluidbook/views/fluidbook.chapters.js +++ b/js/libs/fluidbook/views/fluidbook.chapters.js @@ -1,6 +1,10 @@ function FluidbookChapters(fluidbook, chapters) { this.fluidbook = fluidbook; this.chapters = chapters; + this.style = 'classic'; + if (this.fluidbook.datas.mobileChaptersStyle) { + this.style = this.fluidbook.datas.mobileChaptersStyle; + } this.html = ''; this.lastColor; } @@ -34,16 +38,43 @@ FluidbookChapters.prototype = { } this.html = $(h).get(0).outerHTML; - $(document).on('click', 'ul.chapters a', function() { - var li = $(this).parent(); - var subnav = $(li).children('ul'); - if ($(subnav).length) { - $(subnav).slideToggle(); - return false; - } else { - return true; - } - }); + + if (this.style == 'classic') { + $(document).on('click', 'ul.chapters a', function() { + + var li = $(this).parent(); + var subnav = $(li).children('ul'); + if ($(subnav).length) { + $(subnav).slideToggle(); + return false; + } else { + return true; + } + }); + } else if (this.style == 'ina') { + $(document).on('click', 'ul.chapters a .right', function(e) { + var p = $(this).data('page'); + if (p != '') { + $this.fluidbook.setCurrentPage(p); + e.stopImmediatePropagation(); + e.stopPropagation(); + e.preventDefault(); + return false; + } + + }); + + $(document).on('click', 'ul.chapters a', function() { + var li = $(this).parent(); + var subnav = $(li).children('ul'); + if ($(subnav).length) { + $(subnav).slideToggle(); + return false; + } else { + return true; + } + }); + } }, makeClassicMenu: function() { var $this = this; @@ -71,18 +102,33 @@ FluidbookChapters.prototype = { if (chapter.label.substr(0, 3) == '!!!') { chapter.label = chapter.label.substring(3); - chapter.level='-1'; + chapter.level = '-1'; } + var p = (this.fluidbook.virtualToPhysical(chapter.page)); - - var res = '
  • '; + var res = ''; + if (this.style == 'classic') { + res += '
  • '; + } else if (this.style == 'ina') { + res += '
  • '; + } res += chapter.label; - res += '
  • '; diff --git a/style/fluidbook.css b/style/fluidbook.css index 231c41fe..871fc1fa 100644 --- a/style/fluidbook.css +++ b/style/fluidbook.css @@ -961,6 +961,10 @@ ul.chapters.shareList a.level0 img{ } /* Chapters */ +ul.chapters>li{ + clear: both; +} + ul.chapters a{ display:block; text-align: left; @@ -1007,11 +1011,29 @@ ul.chapters, ul.chapters ul{ list-style: none; } -ul.chapters a .right{ +ul.chapters .right{ + float:right; + display: inline-block; +} + +ul.chapters .right .puce.noshadow{ + border-radius: 0px; + -moz-border-radius: 0px; + -webkit-border-radius: 0px; + -ms-border-radius: 0px; + -o-border-radius: 0px; + + box-shadow: 2px 2px 4px rgba(0,0,0,0); + -moz-box-shadow: 2px 2px 4px rgba(0,0,0,0); + -webkit-box-shadow: 2px 2px 4px rgba(0,0,0,0); + -ms-box-shadow: 2px 2px 4px rgba(0,0,0,0); + -o-box-shadow: 2px 2px 4px rgba(0,0,0,0); + + margin: 0 0 0 15px; float:right; } -ul.chapters a .right .puce{ +ul.chapters .right .puce{ width:25px; height:25px; @@ -1032,6 +1054,11 @@ ul.chapters a .right .puce{ background-repeat: no-repeat; } +ul.chapters a.nodark{ + background-image: none !important; + border-top:1px solid rgba(255,255,255,0.25); +} + ul.chapters a.level0 .right .puce{ margin:2px 0 0 0; }