]> _ Git - fluidbook-html5.git/commitdiff
fix #3149 @0.25
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 23 Oct 2019 09:48:16 +0000 (11:48 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 23 Oct 2019 09:48:16 +0000 (11:48 +0200)
js/libs/fluidbook/fluidbook.resize.js
js/libs/fluidbook/fluidbook.utils.js

index fe8435626cb5f7e2c9cb2a6006d5cb49c57c8df6..7ef0cc682799975bee43ad8cb350bc14c04c99a5 100644 (file)
@@ -421,7 +421,7 @@ FluidbookResize.prototype = {
             return false;
         }
 
-        if (o == 0 || o == 180) {
+        if (o === 0 || o === 180) {
             newo = 'portrait';
             $('body').removeClass('landscape');
         } else {
index 0af9816293ba652b99331d08a9e4e6e537efdc2d..8ba527c6af3a7cbf2acb2ed09b10eafa43288c6c 100644 (file)
@@ -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) {