From: Vincent Vanwaelscappel Date: Wed, 23 Oct 2019 09:48:16 +0000 (+0200) Subject: fix #3149 @0.25 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=149d973afcf4f3d0c25106b198647f59a0718ac1;p=fluidbook-html5.git fix #3149 @0.25 --- diff --git a/js/libs/fluidbook/fluidbook.resize.js b/js/libs/fluidbook/fluidbook.resize.js index fe843562..7ef0cc68 100644 --- a/js/libs/fluidbook/fluidbook.resize.js +++ b/js/libs/fluidbook/fluidbook.resize.js @@ -421,7 +421,7 @@ FluidbookResize.prototype = { return false; } - if (o == 0 || o == 180) { + if (o === 0 || o === 180) { newo = 'portrait'; $('body').removeClass('landscape'); } else { diff --git a/js/libs/fluidbook/fluidbook.utils.js b/js/libs/fluidbook/fluidbook.utils.js index 0af98162..8ba527c6 100644 --- a/js/libs/fluidbook/fluidbook.utils.js +++ b/js/libs/fluidbook/fluidbook.utils.js @@ -52,8 +52,12 @@ function getBaseURL(removeQuery) { } function getSpriteIcon(icon, attrs) { - var a = [], - iconSymbol = $('svg symbol#' + icon); + var a = []; + var iconSymbol = $('svg symbol[id="' + icon + '"]'); + if (iconSymbol.length > 1) { + $('svg symbol[id="' + icon + '"]:not(:last)').remove(); + iconSymbol = $('svg symbol[id="' + icon + '"]'); + } if (iconSymbol.length == 0) { //console.warn('Unable to find sprite icon: ' + icon); @@ -101,7 +105,7 @@ function array_diff(a, b) { }); } -function getIframeDocument(iframe){ +function getIframeDocument(iframe) { iframe = $(iframe).get(0); var doc = iframe.contentWindow || iframe.contentDocument; if (doc.document) {