[minor] [print] create print html in a new window, so as to avoid style creep
This commit is contained in:
parent
7bf744bd44
commit
4f17c8d1ef
1 changed files with 14 additions and 7 deletions
|
|
@ -45,16 +45,23 @@ _p.def_print_style_other = "\n.simpletable, .noborder { \
|
|||
}";
|
||||
|
||||
_p.go = function(html) {
|
||||
var d = document.createElement('div')
|
||||
d.innerHTML = html
|
||||
$(d).printElement();
|
||||
var w = window.open();
|
||||
if(!w) {
|
||||
msgprint(_("Please enable pop-ups"));
|
||||
return;
|
||||
}
|
||||
w.document.write(html);
|
||||
w.print();
|
||||
w.close();
|
||||
}
|
||||
|
||||
_p.preview = function(html) {
|
||||
var w = window.open('');
|
||||
if(!w) return;
|
||||
w.document.write(html)
|
||||
w.document.close();
|
||||
var w = window.open();
|
||||
if(!w) {
|
||||
msgprint(_("Please enable pop-ups"));
|
||||
return;
|
||||
}
|
||||
w.document.write(html);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue