diff --git a/pdf/static/js/pdf_view.js b/pdf/static/js/pdf_view.js index 4a6a873..5753123 100644 --- a/pdf/static/js/pdf_view.js +++ b/pdf/static/js/pdf_view.js @@ -13,5 +13,14 @@ function pdfXBlockInitView(runtime, element) { var handlerUrl = runtime.handlerUrl(element, 'on_download'); $.post(handlerUrl, '{}'); }); + + /* + * tag shows only first page in iPad, iPhone and iPod + * 'View PDF' option will appear in these devices to view pdf in new tab */ + + let isRetinaDevice = /iPad|iPhone|iPod/.test(navigator.userAgent); + if (isRetinaDevice) { + $('.pdf-view-button').show(); + } }); } diff --git a/pdf/templates/html/pdf_view.html b/pdf/templates/html/pdf_view.html index a3ba849..e3ed59e 100644 --- a/pdf/templates/html/pdf_view.html +++ b/pdf/templates/html/pdf_view.html @@ -11,6 +11,9 @@

{% trans display_name %}

{% if allow_download or source_url != "" %}