From f7096802c91db0af10df89903c0dbdcdbb00edfc Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Mon, 14 Apr 2014 13:46:26 +0000 Subject: [PATCH] --- js/libs/fluidbook/fluidbook.background.js | 103 +++++++++++----------- 1 file changed, 52 insertions(+), 51 deletions(-) diff --git a/js/libs/fluidbook/fluidbook.background.js b/js/libs/fluidbook/fluidbook.background.js index 96fc16e9..444ca165 100644 --- a/js/libs/fluidbook/fluidbook.background.js +++ b/js/libs/fluidbook/fluidbook.background.js @@ -1,51 +1,52 @@ -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 != '') { - $("#background").prepend(''); - 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 - }); - } -}; - +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(''); + 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 + }); + } +}; + -- 2.39.5