$(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;
});
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');
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;
});