]> _ Git - fluidbook-html5.git/commitdiff
fix #3795 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 17 Jul 2020 12:58:53 +0000 (14:58 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 17 Jul 2020 12:58:53 +0000 (14:58 +0200)
js/libs/fluidbook/fluidbook.tabs.js

index d562a55fddf7cf875c956706112b563ddb3b2133..d1703d8384cf103b049ed2b3ac189380c8d67712 100644 (file)
@@ -190,6 +190,8 @@ FluidbookTabs.prototype = {
             }
         });
 
+        console.log(page, id, this.links);
+
 
         if (id === 'none') {
             this.svg.find('[id^="o"].active').removeClass('active');
@@ -308,58 +310,58 @@ FluidbookTabs.prototype = {
             });
         }
 
-        if (this.hideOnLastPage || this.hideOnFirstPage) {
-            if (this.hideOnLastPage) {
-                this.visibility.lastpage = true;
-            }
-            if (this.hideOnFirstPage) {
-                this.visibility.firstpage = true;
-            }
 
-            $(this.fluidbook).on('fluidbook.page.change.start', function (e, page) {
-                if ($this.hideOnFirstPage) {
-                    if (page <= 1) {
-                        $this.changeVisibility('firstpage', false);
-                    }
+        if (this.hideOnLastPage) {
+            this.visibility.lastpage = true;
+        }
+        if (this.hideOnFirstPage) {
+            this.visibility.firstpage = true;
+        }
+
+        $(this.fluidbook).on('fluidbook.page.change.start', function (e, page) {
+            if ($this.hideOnFirstPage) {
+                if (page <= 1) {
+                    $this.changeVisibility('firstpage', false);
                 }
-                if ($this.hideOnLastPage) {
-                    var last = $this.fluidbook.settings.pages;
-                    if (last % 2 === 1) {
-                        last--;
-                    }
-                    if (page >= last) {
-                        $this.changeVisibility('lastpage', false);
-                    }
+            }
+            if ($this.hideOnLastPage) {
+                var last = $this.fluidbook.settings.pages;
+                if (last % 2 === 1) {
+                    last--;
                 }
-                $this.changePage(page);
-            });
+                if (page >= last) {
+                    $this.changeVisibility('lastpage', false);
+                }
+            }
+            $this.changePage(page);
+        });
 
-            $(this.fluidbook).on('fluidbook.page.change.end', function (e, page) {
-                if ($this.hideOnFirstPage) {
-                    if (page > 1) {
-                        $this.changeVisibility('firstpage', true);
-                    }
+        $(this.fluidbook).on('fluidbook.page.change.end', function (e, page) {
+            if ($this.hideOnFirstPage) {
+                if (page > 1) {
+                    $this.changeVisibility('firstpage', true);
                 }
-                if ($this.hideOnLastPage) {
-                    var last = $this.fluidbook.settings.pages;
-                    if (last % 2 === 1) {
-                        last--;
-                    }
-                    if (page < last) {
-                        $this.changeVisibility('lastpage', true);
-                    }
+            }
+            if ($this.hideOnLastPage) {
+                var last = $this.fluidbook.settings.pages;
+                if (last % 2 === 1) {
+                    last--;
                 }
-            });
+                if (page < last) {
+                    $this.changeVisibility('lastpage', true);
+                }
+            }
+        });
 
-            $(document).on('mouseover', '.tablink[data-labelid]', function () {
-                $this.svg.find('[id^="t"].active').removeClass('active');
-                $this.svg.find('#' + $(this).data('labelid')).addClass('active');
-            });
+        $(document).on('mouseover', '.tablink[data-labelid]', function () {
+            $this.svg.find('[id^="t"].active').removeClass('active');
+            $this.svg.find('#' + $(this).data('labelid')).addClass('active');
+        });
+
+        $(document).on('mouseout', '.tablink[data-labelid]', function () {
+            $this.svg.find('[id^="t"].active').removeClass('active');
+        });
 
-            $(document).on('mouseout', '.tablink[data-labelid]', function () {
-                $this.svg.find('[id^="t"].active').removeClass('active');
-            });
-        }
     },
 
     changeVisibility: function (type, visible) {