From: Vincent Vanwaelscappel Date: Tue, 28 Apr 2020 16:38:35 +0000 (+0200) Subject: fix #3620 @3 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=83a7e4f32e84cfb8b0d322705ae3b06bceb4f97d;p=fluidbook-html5.git fix #3620 @3 --- diff --git a/js/libs/fluidbook/fluidbook.links.js b/js/libs/fluidbook/fluidbook.links.js index e2a1e2cd..1dd477e4 100644 --- a/js/libs/fluidbook/fluidbook.links.js +++ b/js/libs/fluidbook/fluidbook.links.js @@ -289,7 +289,8 @@ FluidbookLinks.prototype = { if (animation.type === undefined || animation.type === '') { return; } - var defaultParams; + var defaultParams = {}; + var globalDefault = {zindex: 0}; var w = parseFloat(link.css('width')); var cx = w / 2; var h = parseFloat(link.css('height')); @@ -298,16 +299,19 @@ FluidbookLinks.prototype = { var to = {}; var duration = 0.5; var tweenmax = true; + + animation = $.extend({}, globalDefault, defaultParams, animation); + if (animation.duration !== undefined) { duration = parseFloat(animation.duration); } + var css = {}; if (animation.ease == undefined) { animation.ease = "Power1.easeOut"; } to.ease = animation.ease; - if (animation.delay !== undefined) { to.delay = parseFloat(animation.delay); } @@ -348,7 +352,7 @@ FluidbookLinks.prototype = { } } else if (animation.type === 'pie') { defaultParams = {startAngle: '0', direction: 'clockwise', size: 'outside', innerRadius: '0'}; - animation = $.extend({}, defaultParams, animation); + animation = $.extend({}, globalDefault, defaultParams, animation); animation.startAngle = parseFloat(animation.startAngle); animation.innerRadius = parseFloat(animation.innerRadius); if (animation.direction === 'clockwise') { @@ -417,7 +421,7 @@ FluidbookLinks.prototype = { suffix: '', scale: 1, }; - animation = $.extend({}, defaultParams, animation); + animation = $.extend({}, globalDefault, defaultParams, animation); animation.startValue = parseFloat(animation.startValue.replace(/,/, '.')); animation.decimalDigitNumber = parseInt(animation.decimalDigitNumber); animation.letterSpacing = parseFloat(animation.letterSpacing); @@ -439,14 +443,13 @@ FluidbookLinks.prototype = { } }; - var css = { + css = { textAlign: animation.align, letterSpacing: animation.letterSpacing, opacity: 0, transform: "scale(" + animation.scale + ")", } - link.css(css); var value = parseFloat(link.text().replace(/,/, '.')); link.text(''); var countup = new CountUp(link.attr('id'), value, options); @@ -455,6 +458,9 @@ FluidbookLinks.prototype = { countup.start(); }, to.delay * 1000); } + css = $.extend({zIndex: 500 + parseInt(animation.zindex)}, css); + console.log(css); + link.css(css); link.show(); if (tweenmax) { TweenMax.fromTo(linkElement, duration, from, to); diff --git a/style/fluidbook.less b/style/fluidbook.less index edaa642c..ee65be6a 100644 --- a/style/fluidbook.less +++ b/style/fluidbook.less @@ -1254,7 +1254,7 @@ html.ios body.portrait #interface { } .link.contentLink { - z-index: 0 !important; + z-index: 500; position: absolute; pointer-events: none;