Sha256: 0c41e7c14ffeff538d867fd4fd51af8517a1f0d803898e40a5b0a2816d96ebed

Contents?: true

Size: 680 Bytes

Versions: 176

Compression:

Stored size: 680 Bytes

Contents

//
// When a .print_pdf link is clicked, use its data-target attribute with
// http://printjs.crabbly.com/ to print the PDF. This, without leaving the current page,
// will bring up the print dialog. IE 11/Edge not supported however.
//
$(document).ready(function() {
  $(".print-pdf").on("click", function(e) {

    // detect IE8 and above, and edge
    if (document.documentMode || /Edge/.test(navigator.userAgent)) {
      // Revert to the default behaviour of showing the PDF in a new tab and the user
      // must print manually.
    } else {
      var url = $(this).data("target");
      if (url) {
        e.preventDefault();
        printJS(url);
      }
    }
  });
});

Version data entries

176 entries across 176 versions & 1 rubygems

Version Path
renalware-core-2.0.0.pre.rc9 app/assets/javascripts/renalware/pdf.js
renalware-core-2.0.0.pre.rc8 app/assets/javascripts/renalware/pdf.js
renalware-core-2.0.0.pre.rc7 app/assets/javascripts/renalware/pdf.js
renalware-core-2.0.0.pre.rc6 app/assets/javascripts/renalware/pdf.js
renalware-core-2.0.0.pre.rc5 app/assets/javascripts/renalware/pdf.js
renalware-core-2.0.0.pre.rc4 app/assets/javascripts/renalware/pdf.js
renalware-core-2.0.0.pre.rc3 app/assets/javascripts/renalware/pdf.js
renalware-core-2.0.0.pre.rc1 app/assets/javascripts/renalware/pdf.js
renalware-core-2.0.0.pre.beta12 app/assets/javascripts/renalware/pdf.js
renalware-core-2.0.0.pre.beta11 app/assets/javascripts/renalware/pdf.js
renalware-core-2.0.0.pre.beta10 app/assets/javascripts/renalware/pdf.js
renalware-core-2.0.0.pre.beta9 app/assets/javascripts/renalware/pdf.js
renalware-core-2.0.0.pre.beta8 app/assets/javascripts/renalware/pdf.js
renalware-core-2.0.0.pre.beta7 app/assets/javascripts/renalware/pdf.js
renalware-core-2.0.0.pre.beta6 app/assets/javascripts/renalware/pdf.js
renalware-core-2.0.0.pre.beta5 app/assets/javascripts/renalware/pdf.js