]> _ Git - fluidbook-html5.git/commitdiff
wip #1776 @1.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 2 Nov 2017 16:34:17 +0000 (17:34 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 2 Nov 2017 16:34:17 +0000 (17:34 +0100)
js/libs/fluidbook/fluidbook.links.js

index 7b0cd3606eff1afe689a11e291c989a75d8e2e96..6cfaddb4d983af1241f8bca162442249ce6ae124 100644 (file)
@@ -37,6 +37,13 @@ FluidbookLinks.prototype = {
             return false;
         });
 
+        $(document).on('click', 'a[href^="http"]', function () {
+            if (!navigator.onLine && this.fluidbook.datas.phonegap) {
+                window.alert(this.fluidbook.l10n.__('Une connexion internet est requise pour cette action.'));
+                return false;
+            }
+        });
+
         $(document).on('click touchend', '[data-action]', function () {
             var map = {'pdf': 'print', 'fullScreen': "fullscreen", 'locales': 'localesContainers'};
             var action = $(this).data('action');
@@ -61,7 +68,6 @@ FluidbookLinks.prototype = {
             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) {