From ae12ec238c91a28235d328b1ddd527a6631c3bcb Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Wed, 16 Oct 2013 11:47:34 +0000 Subject: [PATCH] --- js/libs/fluidbook/fluidbook.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/js/libs/fluidbook/fluidbook.js b/js/libs/fluidbook/fluidbook.js index abbb733f..76007dbb 100644 --- a/js/libs/fluidbook/fluidbook.js +++ b/js/libs/fluidbook/fluidbook.js @@ -1240,14 +1240,22 @@ Fluidbook.prototype = { }, print: function() { var $this = this; - var pdf = getBaseURL() + '/data/' + this.datas.pdfName; + var pdf; + var pdfName; + if (this.datas.pdfName.substr(0, 4) == 'http') { + pdf = this.datas.pdfName; + } else { + pdf = getBaseURL() + '/data/' + this.datas.pdfName; + } + var e = pdf.split('/'); + pdfName = e.pop(); if (this.gal) { this.displayLoader(); this.gal.downloadAndCall('extras', function() { - $this._openFile(pdf, $("#print"), 'pdf', $this.datas.pdfName); + $this._openFile(pdf, $("#print"), 'pdf', pdfName); }); } else { - this._openFile(pdf, $("#print"), 'pdf', this.datas.pdfName); + this._openFile(pdf, $("#print"), 'pdf', pdfName); } }, _openFile: function(url, e, type, localname) { -- 2.39.5