]> _ Git - fluidbook-html5.git/commitdiff
wip #4195 @0.25
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 14 Jan 2021 09:33:22 +0000 (10:33 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 14 Jan 2021 09:33:22 +0000 (10:33 +0100)
js/libs/fluidbook/fluidbook.tabs.js

index 0fd2d90b6d6563cc72e056fe489bb998797284a4..9a5bea597a9dbdfcc241343dbf741b3d49eee64d 100644 (file)
@@ -97,6 +97,19 @@ FluidbookTabs.prototype = {
         });
     },
 
+    updateClasses: function () {
+        if (!this.fluidbook.cache.isset('tabsClasses')) {
+            return;
+        }
+        var $this=this;
+        var classes = this.fluidbook.cache.get('tabsClasses');
+        $.each(classes, function (o, classes) {
+            $this.svg.find('#o' + o).attr('class', classes);
+        });
+
+        this.changePage(this.fluidbook.currentPage);
+    },
+
     addLinks: function (pages) {
         pages = pages.map(function (x) {
             if (x === '-') {
@@ -169,6 +182,7 @@ FluidbookTabs.prototype = {
             $this.svgLoaded = true;
             $this.createLinks();
             $this.initStandardEvents();
+            $this.updateClasses();
         }, 'text');
     },
 
@@ -333,8 +347,8 @@ FluidbookTabs.prototype = {
         });
     },
 
-    checkPageVisibility(){
-        var $this=this;
+    checkPageVisibility() {
+        var $this = this;
         var pages = this.fluidbook.getDisplayedPages();
         var hide = false;
         $.each(pages, function (k, p) {