bremen_short_url/BackEnd/assets/javascript/pages/invoice-demo.min.js

3 lines
1.1 KiB
JavaScript

"use strict";function _classCallCheck(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,n){for(var t=0;t<n.length;t++){var i=n[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function _createClass(e,n,t){return n&&_defineProperties(e.prototype,n),t&&_defineProperties(e,t),e}var InvoiceDemo=function(){function e(){_classCallCheck(this,e),this.init()}return _createClass(e,[{key:"init",value:function(){this.saveToPDF()}},{key:"saveToPDF",value:function(){var n=html2pdf(),t=document.getElementById("invoice"),e=$(t),i=e.parent(),o=e.data("id"),a=$("<img />");n.from(t).toImg().then(function(){e.css("display","none"),a.prop("alt",o).prop("src",n.prop.img.src).addClass("invoice-img").css("max-width","".concat(e.outerWidth(),"px")),i.append(a)}),$("#download-pdf").on("click",function(e){e.preventDefault(),n.from(t).toPdf().save(o)})}}]),e}();$(document).on("theme:init",function(){new InvoiceDemo});
//# sourceMappingURL=../../sourcemaps/pages/invoice-demo.min.js.map