]> _ Git - fluidbook-html5.git/commitdiff
wip #5103 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 16 Feb 2022 09:50:07 +0000 (10:50 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 16 Feb 2022 09:50:07 +0000 (10:50 +0100)
js/libs/fluidbook/fluidbook.bookmarks.js

index dd35948b16f62933f1853dd86e21a31133908f7c..92ef180f431c0b9d49b42599269bd7d987ef1b99 100644 (file)
@@ -52,13 +52,18 @@ FluidbookBookmarks.prototype = {
             return false;
         });
 
-        $(document).on(this.fluidbook.input.clickEvent, '.bookmarkssub a.download', function () {
+        $(document).on(this.fluidbook.input.clickEvent, '.bookmarkssub a.download,.bookmarkssub a.print', function () {
             $(this).data('ios-preview', '1');
             if (!navigator.onLine && $this.fluidbook.settings.phonegap) {
                 $this.fluidbook.alertInternetRequired();
                 return false;
             }
-            $this.openPDF($(this), false);
+            var print = $(this).hasClass('print');
+            if ($this.fluidbook.settings.bookmarkFunctionsMainMenu) {
+                $this.fluidbook.menu.openView(print ? 'print' : 'download');
+            } else {
+                $this.openPDF($(this), print);
+            }
             return false;
         });
 
@@ -437,6 +442,7 @@ FluidbookBookmarks.prototype = {
         if (downloadLabel === '') {
             downloadLabel = this.fluidbook.l10n.__('download');
         }
+        var printLabel = this.fluidbook.l10n.__('print');
 
         var contentClass = 'content';
         if (this.fluidbook.mobilefirst.enabled) {
@@ -495,7 +501,10 @@ FluidbookBookmarks.prototype = {
         if (this.fluidbook.settings.friend && this.fluidbook.settings.bookmarkSendEnable) {
             index += '<a role="button" aria-label="' + this.fluidbook.l10n.__('send') + '" class="send" href="#">' + this.fluidbook.l10n.__('send') + '</a>';
         }
-        if (this.fluidbook.settings.print || this.fluidbook.settings.pdf) {
+        if (this.fluidbook.settings.print && this.fluidbook.settings.bookmarkPrint) {
+            index += '<a role="button" aria-label="' + printLabel + '" class="print" href="#">' + printLabel + '</a>';
+        }
+        if (this.fluidbook.settings.pdf) {
             // ToDo: differentiate between download & print?
             index += '<a role="button" aria-label="' + downloadLabel + '" class="download" href="#">' + downloadLabel + '</a>';
         }