From a8b33ac7090b3c9d230b063c80f22cc8096bef12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Sun, 3 Jan 2016 16:56:17 +0100 Subject: [PATCH] misc: fix compatibility with recent pdf.js versions --- welco/sources/mail/static/js/welco.viewer.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/welco/sources/mail/static/js/welco.viewer.js b/welco/sources/mail/static/js/welco.viewer.js index 17e511d..a9eec36 100644 --- a/welco/sources/mail/static/js/welco.viewer.js +++ b/welco/sources/mail/static/js/welco.viewer.js @@ -1,3 +1,7 @@ window.addEventListener('message', function(event) { - PDFViewerApplication.open(event.data); + if (typeof(PDFViewerApplication) !== 'undefined') { + PDFViewerApplication.open(event.data); + } else { + PDFView.open(event.data); + } }, false);