]> _ Git - fluidbook-html5.git/commitdiff
done #1545 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 6 Jul 2017 12:18:25 +0000 (14:18 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 6 Jul 2017 12:18:25 +0000 (14:18 +0200)
js/libs/fluidbook/menu/fluidbook.chapters.js

index f470cafcd2d633bd3df6df641a59a7314bbadc6a..3569640aa30c19a9299a544135a3b053426ea357 100644 (file)
@@ -2,6 +2,7 @@ function FluidbookChapters(fluidbook, chapters) {
     this.fluidbook = fluidbook;
     this.chapters = chapters;
     this.style = 'classic';
+    this.cascade = this.fluidbook.datas.chaptersCascade;
     if (this.fluidbook.datas.mobileChaptersStyle) {
         this.style = this.fluidbook.datas.mobileChaptersStyle;
     }
@@ -18,7 +19,7 @@ FluidbookChapters.prototype = {
     },
     makeView: function () {
         this.makeClassicMenu();
-        if (this.fluidbook.datas.chaptersCascade) {
+        if (this.cascade) {
             this.makeCascadeMenu();
         }
     },
@@ -96,12 +97,12 @@ FluidbookChapters.prototype = {
         if (chapter.page != '') {
             var p = this.fluidbook.virtualToPhysical(chapter.page);
             if (p === false) {
-                href = "nohref";
+                href = this.cascade ? 'href="#"' : "nohref";
             } else {
                 href = 'href="#/page/' + p + '"';
             }
         } else {
-            href = "nohref";
+            href = this.cascade ? 'href="#"' : "nohref";
         }
         if (this.style == 'classic') {
             res += '<li data-level="' + chapter.level + '"><a ' + href + ' class="level' + chapter.level + '">';