]> _ Git - fluidbook-html5.git/commitdiff
wip #2657 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 29 Mar 2019 14:55:12 +0000 (15:55 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 29 Mar 2019 14:55:12 +0000 (15:55 +0100)
js/libs/fluidbook/fluidbook.js
js/libs/fluidbook/fluidbook.mobilefirst.js [new file with mode: 0644]

index 80626b7b1716fc9ea87d3acc73f97c674e6fd9ca..644d1153a9d0786c9aa6371d385ce62e02ca0d6c 100644 (file)
@@ -42,6 +42,7 @@ Fluidbook.prototype = {
         this.loader = new FluidbookLoader(this);
         this.search = new FluidbookSearch(this);
         this.pad = new FluidbookPad(this);
+        this.mobilefirst = new FluidbookMobileFirst(this);
         this.scorm = new FluidbookScorm(this);
         this.links = new FluidbookLinks(this);
         this.waiters = [];
diff --git a/js/libs/fluidbook/fluidbook.mobilefirst.js b/js/libs/fluidbook/fluidbook.mobilefirst.js
new file mode 100644 (file)
index 0000000..89223ad
--- /dev/null
@@ -0,0 +1,15 @@
+function FluidbookMobileFirst(fluidbook) {
+    this.fluidbook = fluidbook;
+    this.enabled = this.fluidbook.datas.mobileNavigationType === 'mobilefirst';
+    if (this.enabled) {
+        this.init();
+    }else{
+        $("html").addClass('no-mobilefirst');
+    }
+}
+
+FluidbookMobileFirst.prototype = {
+    init: function () {
+        $("html").addClass('mobilefirst');
+    },
+}
\ No newline at end of file