]> _ Git - fluidbook-html5.git/commitdiff
done #1776 @3
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 3 Nov 2017 15:47:35 +0000 (16:47 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 3 Nov 2017 15:47:35 +0000 (16:47 +0100)
js/libs/fluidbook/fluidbook.bookmarks.js
js/libs/fluidbook/fluidbook.js
js/libs/fluidbook/fluidbook.links.js

index 9c6aaab2acdba83222209f8c5eb6f7d0d66386ff..4ef246785ca2a9ddba546ee83c2f0d735b0d3685 100644 (file)
@@ -45,6 +45,10 @@ FluidbookBookmarks.prototype = {
 
         $(document).on('click', '.bookmarkssub a.print', function () {
             $(this).data('ios-preview', '1');
+            if (!navigator.onLine && $this.fluidbook.datas.phonegap) {
+                $this.fluidbook.alertInternetRequired();
+                return false;
+            }
             $this.fluidbook._openFile($this.getPDF(), $(this), 'pdf', $this.getBookmarksCompacted() + '.pdf');
             return false;
         });
index 10349946e2669290d8a71de104a07a0ecf4c0cb9..dc2eb8e6e91e0433f56ae0a137639ac62ad1fa32 100644 (file)
@@ -951,6 +951,12 @@ Fluidbook.prototype = {
         return a.cloneNode(false).href;
     },
 
+    alertInternetRequired: function () {
+        navigator.notification.alert('', function () {
+
+        }, this.l10n.__('an internet connection is required for this action'));
+    },
+
     touchOffset: function (offset) {
         offset *= $("#currentDoublePage").width();
         $("#currentDoublePage").addClass('sliding');
index 26c7eb8f38bed12fd575bfee39940515a5bd6ce0..738246a9b088de6069f1b9bdf537e11250820526 100644 (file)
@@ -37,10 +37,12 @@ FluidbookLinks.prototype = {
             return false;
         });
 
-        $(document).on('click', 'a[href^="http"]', function () {
-            if (!navigator.onLine && this.fluidbook.datas.phonegap) {
-                navigator.notification.alert(this.fluidbook.l10n.__('an internet connection is required for this action'));
-                return false;
+        $(document).on('click', 'a[href^="http"]', function (e) {
+            if (!navigator.onLine && $this.fluidbook.datas.phonegap) {
+                $this.fluidbook.alertInternetRequired();
+                e.preventDefault();
+                e.stopPropagation();
+                e.stopImmediatePropagation();
             }
             return true;
         });