From 149d973afcf4f3d0c25106b198647f59a0718ac1 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Wed, 23 Oct 2019 11:48:16 +0200 Subject: [PATCH] fix #3149 @0.25 --- js/libs/fluidbook/fluidbook.resize.js | 2 +- js/libs/fluidbook/fluidbook.utils.js | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) 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) { -- 2.39.5