]> _ Git - fluidbook-html5.git/commitdiff
(no commit message)
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 14 Apr 2014 13:46:26 +0000 (13:46 +0000)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 14 Apr 2014 13:46:26 +0000 (13:46 +0000)
js/libs/fluidbook/fluidbook.background.js

index 96fc16e912474e394dfc4fdacd51b11de83a39ae..444ca165b9fc4f272d5bf1f299efc072ff7668ab 100644 (file)
@@ -1,51 +1,52 @@
-function FluidbookBackground(fluidbook) {\r
-       this.fluidbook = fluidbook;\r
-       this.hasLinks = false;\r
-       this.init();\r
-}\r
-\r
-FluidbookBackground.prototype = {\r
-       init: function() {\r
-               if (this.fluidbook.datas.links.background != undefined\r
-                               && this.fluidbook.datas.repeat != Fluidbook.REPEAT\r
-                               && this.fluidbook.datas.repeat != Fluidbook.STRETCH\r
-                               && this.fluidbook.datas.links.background != '') {\r
-                       $("#background").prepend('<div class="links">' + this.fluidbook.datas.links.background + '</div>');\r
-                       hasLinks = true;\r
-               }\r
-       },\r
-       resize: function(w, h) {\r
-               if (!this.hasLinks) {\r
-                       return;\r
-               }\r
-\r
-               var left, top, iw, ih;\r
-               if (this.fluidbook.datas.repeat == Fluidbook.NONE) {\r
-                       iw = this.fluidbook.datas.backgroundImageDimensions.width;\r
-                       ih = this.fluidbook.datas.backgroundImageDimensions.height;\r
-               }\r
-\r
-               if (this.fluidbook.datas.backgroundHAlign == Fluidbook.LEFT) {\r
-                       left = 0\r
-               } else if (this.fluidbook.datas.backgroundHAlign == Fluidbook.RIGHT) {\r
-                       left = w - iw;\r
-               } else if (this.fluidbook.datas.backgroundHAlign == Fluidbook.CENTER) {\r
-                       left = (w - iw) / 2;\r
-               }\r
-\r
-\r
-               if (this.fluidbook.datas.backgroundVAlign == Fluidbook.TOP) {\r
-                       top = 0\r
-               } else if (this.fluidbook.datas.backgroundVAlign == Fluidbook.BOTTOM) {\r
-                       top = h - ih;\r
-               } else if (this.fluidbook.datas.backgroundVAlign == Fluidbook.MIDDLE) {\r
-                       top = (h - ih) / 2;\r
-               }\r
-\r
-               $("#background .links").css({\r
-                       top: top,\r
-                       left: left\r
-               });\r
-       }\r
-};\r
-\r
+function FluidbookBackground(fluidbook) {
+       this.fluidbook = fluidbook;
+       this.hasLinks = false;
+       this.init();
+}
+
+FluidbookBackground.prototype = {
+       init: function() {
+               if (this.fluidbook.datas.links.background != undefined
+                               && this.fluidbook.datas.repeat != Fluidbook.REPEAT
+                               && this.fluidbook.datas.repeat != Fluidbook.STRETCH
+                               && this.fluidbook.datas.links.background != ''
+                               && this.fluidbook.datas.mobileIgnoreBackgroundLinks === false) {
+                       $("#background").prepend('<div class="links">' + this.fluidbook.datas.links.background + '</div>');
+                       hasLinks = true;
+               }
+       },
+       resize: function(w, h) {
+               if (!this.hasLinks) {
+                       return;
+               }
+
+               var left, top, iw, ih;
+               if (this.fluidbook.datas.repeat == Fluidbook.NONE) {
+                       iw = this.fluidbook.datas.backgroundImageDimensions.width;
+                       ih = this.fluidbook.datas.backgroundImageDimensions.height;
+               }
+
+               if (this.fluidbook.datas.backgroundHAlign == Fluidbook.LEFT) {
+                       left = 0
+               } else if (this.fluidbook.datas.backgroundHAlign == Fluidbook.RIGHT) {
+                       left = w - iw;
+               } else if (this.fluidbook.datas.backgroundHAlign == Fluidbook.CENTER) {
+                       left = (w - iw) / 2;
+               }
+
+
+               if (this.fluidbook.datas.backgroundVAlign == Fluidbook.TOP) {
+                       top = 0
+               } else if (this.fluidbook.datas.backgroundVAlign == Fluidbook.BOTTOM) {
+                       top = h - ih;
+               } else if (this.fluidbook.datas.backgroundVAlign == Fluidbook.MIDDLE) {
+                       top = (h - ih) / 2;
+               }
+
+               $("#background .links").css({
+                       top: top,
+                       left: left
+               });
+       }
+};
+