]> _ Git - fluidbook-html5.git/commitdiff
done #1781 @5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 7 Nov 2017 13:25:02 +0000 (14:25 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 7 Nov 2017 13:25:02 +0000 (14:25 +0100)
js/libs/fluidbook/fluidbook.js
js/libs/fluidbook/fluidbook.links.js
js/main.js

index dc2eb8e6e91e0433f56ae0a137639ac62ad1fa32..1e07f9ce4663dbce72105987e2d54faac7ee5440 100644 (file)
@@ -1009,6 +1009,19 @@ Fluidbook.prototype = {
             options = '';
         }
 
+        var mtarget = target;
+        if (this.datas.phonegap) {
+            if(target=='_unique' || target=='_new') {
+                mtarget = '_blank';
+            }
+        } else {
+            if (target == '_new') {
+                mtarget = 'fb_' + $this.fluidbook.datas.id + '_' + Math.round(Math.random() * 10000000);
+            } else if (target == '_unique') {
+                mtarget = 'fb_' + $this.fluidbook.datas.id;
+            }
+        }
+
         var locationdefault = 'yes';
         if (this.datas.phonegap) {
             locationdefault = 'yes';
@@ -1019,6 +1032,10 @@ Fluidbook.prototype = {
         } else if (options.indexOf('location=') == -1) {
             options += ',location=' + locationdefault;
         }
-        window.open(url, target, options);
+
+        if (this.datas.phonegap && mtarget=='_blank') {
+            options += ',zoom=yes,enableViewportScale=yes'
+        }
+        window.open(url, mtarget, options);
     }
 }
\ No newline at end of file
index 738246a9b088de6069f1b9bdf537e11250820526..7448715cfbaf1b50df744e7f56627a7e42cece66 100644 (file)
@@ -61,16 +61,6 @@ FluidbookLinks.prototype = {
 
             return false;
         });
-
-        $(document).on('click', 'a[target="_unique"]', function () {
-            window.open($(this).attr('href'), 'fb_' + $this.fluidbook.datas.id, "resizable=1,scrollbars=1", true);
-            return false;
-        });
-
-        $(document).on('click', 'a[target="_new"]', function () {
-            window.open($(this).attr('href'), 'fb_' + $this.fluidbook.datas.id + '_' + Math.round(Math.random() * 10000000), "resizable=1,scrollbars=1", true);
-            return false;
-        });
     },
     initLinks: function (pageNr) {
         if (pageNr == undefined) {
index 301e87d2f87653148435779abcec54c3e7235634..aa8edfab23c0a28b061f3d056f8657d708b94b4a 100644 (file)
@@ -388,7 +388,7 @@ try {
             if ($(this).data('type') == 16 && $(this).attr('href').substr(0, 4) == 'http') {
                 target = '_system';
             }
-            if (target == '_blank' || target == '_system') {
+            if (target == '_blank' || target == '_system' || target=='_unique' || target=='_new') {
                 fluidbook.wopen($(this).attr('href'), target);
                 return false;
             }