jQueryPlugins icon indicating copy to clipboard operation
jQueryPlugins copied to clipboard

printElement does not work in Opera 12

Open ghost opened this issue 12 years ago • 0 comments

Since Opera 12 printElement does only show a popup with contents but does not print and does not close popup.

  1. print problem

Seems to be the fact, that print should be called after a delay. That means:

   !d.browser.opera ? 'print();' : 'setTimeout("window.print()", 1000);' 

should make it.

i solved this issue in printElement 1.2 by changing

html.push('<script type="text/javascript">function printPage(){focus();print();' + ((!$.browser.opera && !opts["leaveOpen"] && opts["printMode"].toLowerCase() == 'popup') ? 'close();' : '') + '}</script>');

to

  html.push('<script type="text/javascript">function printPage(){focus();' + ( !d.browser.opera ? 'print();' : 'setTimeout("window.print()", 1000);' ) + (!d.browser.opera && !b.leaveOpen && b.printMode.toLowerCase() === "popup" ? "close();" : "") + "}</script>");
  1. Not closing popup

After fixing the print() i recognized that the popup does not close after correct printing. Can this be solved?

ghost avatar Sep 13 '12 17:09 ghost