var rand = Math.round(Math.random() * 100000);
this.waiters.push(rand);
return rand;
- }, waiterActive: function (id) {
+ },
+ waiterActive: function (id) {
return this.waiters.indexOf(id) > -1;
- }, resetWaiters: function () {
+ },
+ resetWaiters: function () {
this.waiters = [];
- }, physicalToVirtual: function (page) {
+ },
+ physicalToVirtual: function (page) {
return this.settings.numerotation[page - 1];
- }, virtualToPhysical: function (page) {
+ },
+
+ virtualToPhysical: function (page) {
if (page === undefined) {
return false;
}
});
$(document).on(this.fluidbook.input.clickEvent, '[data-action]', function () {
- var map = {'pdf': 'print', 'fullScreen': "fullscreen", 'locales': 'localesContainers', 'basket': 'cart'};
+ var map = {'fullScreen': "fullscreen", 'locales': 'localesContainers', 'basket': 'cart'};
var action = $(this).data('action');
var extra = $(this).data('extra');
return true;
}
+ if (action === 'pdf') {
+ $this.fluidbook.nav.clickDownloadIcon();
+ return false;
+ }
+ if (action === 'print') {
+ $this.fluidbook.nav.clickPrintIcon();
+ return false;
+ }
+
if (map[action]) {
action = map[action];
}
}
return $("#" + elementID).get(0);
},
+
getLink: function (name, href, id, title, help, className, showIcon, navType, keyboardShortcut) {
if (showIcon === undefined) {
showIcon = true;
// Download icon
$(document).on(this.fluidbook.input.clickEvent, '.icon-download', function (event) {
event.preventDefault();
-
- // Should we show complex PDF download options? Or just give them the full PDF?
- if ($this.fluidbook.settings.pdfComplex && $this.fluidbook.settings.phonegap === false) {
- $this.fluidbook.menu.openView('download');
- } else {
- $this.fluidbook.downloadPDF($(this));
- }
-
+ $this.clickDownloadIcon();
return false;
});
// Print icon
$(document).on(this.fluidbook.input.clickEvent, '.icon-print', function () {
- if (!$this.fluidbook.printing.advancedPrint()) {
- $this.fluidbook.print($(this));
- return false;
- } else {
- $this.fluidbook.menu.openView('print');
- }
+ $this.clickPrintIcon();
return false;
});
}
},
+ clickPrintIcon: function () {
+ if (!this.fluidbook.printing.advancedPrint()) {
+ this.fluidbook.print($(this));
+ } else {
+ this.fluidbook.menu.openView('print');
+ }
+ },
+
+ clickDownloadIcon: function () {
+ // Should we show complex PDF download options? Or just give them the full PDF?
+ if (this.fluidbook.settings.pdfComplex && this.fluidbook.settings.phonegap === false) {
+ this.fluidbook.menu.openView('download');
+ } else {
+ this.fluidbook.downloadPDF($(this));
+ }
+
+ },
+
initFullScreen: function () {
var $this = this;