]> _ Git - fluidbook-html5.git/commitdiff
#1859 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 5 Jan 2018 19:19:09 +0000 (20:19 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 5 Jan 2018 19:19:09 +0000 (20:19 +0100)
js/libs/fluidbook/fluidbook.js
js/libs/fluidbook/fluidbook.links.js

index 6a0722eaa7559631294351fbb3d8d46a67fc711f..1fad66fa34222a544c7b3db321abb5f85957b25d 100644 (file)
@@ -34,6 +34,9 @@ Fluidbook.prototype = {
         this.loader = new FluidbookLoader(this);
         this.search = new FluidbookSearch(this);
         this.pad = new FluidbookPad(this);
+        if (this.datas.scorm_enable) {
+            this.scorm = new FluidbookScorm(this);
+        }
         this.links = new FluidbookLinks(this);
         this.waiters = [];
         this.viewport = new FluidbookViewport(this);
@@ -50,9 +53,6 @@ Fluidbook.prototype = {
         this.tooltip = new FluidbookTooltip(this);
         this.audiodescription = new FluidbookAudioDescription(this);
         this.sound = new FluidbookSound(this);
-        if (this.datas.scorm_enable) {
-            this.scorm = new FluidbookScorm(this);
-        }
 
         if (this.datas.form == 'bulle') {
             this.form = new FluidbookBulleForm(this);
@@ -1067,11 +1067,13 @@ Fluidbook.prototype = {
             if (this.support.IE == 0) {
                 w = window.open(url, mtarget);
             } else {
-                $(body).append('<a id="wopen" href="' + url + '" target="' + mtarget + '"></a>');
-                $("#wopen").trigger('click');
                 $("#wopen").remove();
+                $('body').append('<a id="wopen" href="' + url + '" target="' + mtarget + '"></a>');
+                $("#wopen").get(0).click();
+                setTimeout(function () {
+                    $("#wopen").remove();
+                }, 200);
             }
-
         } else {
             w = window.open(url, mtarget, options, replace);
         }
index 26c89584143a569d6c1f7f047d00ed7473ccd8d5..a2f728297b68230f967f453a23a47c3f5ced576b 100644 (file)
@@ -41,6 +41,11 @@ FluidbookLinks.prototype = {
         $(document).on('click', 'a', function () {
             // console.log('click link ');
             // console.log($(this));
+
+            if ($(this).is('#wopen')) {
+                return true;
+            }
+
             var target = $(this).attr('target');
             if (!target) {
                 target = '_self';