Ver a proveniência

[minor] [print] create print html in a new window, so as to avoid style creep

version-14
Anand Doshi há 12 anos
ascendente
cometimento
4f17c8d1ef
1 ficheiros alterados com 14 adições e 7 eliminações
  1. +14
    -7
      public/js/legacy/widgets/form/print_format.js

+ 14
- 7
public/js/legacy/widgets/form/print_format.js Ver ficheiro

@@ -45,16 +45,23 @@ _p.def_print_style_other = "\n.simpletable, .noborder { \
}"; }";


_p.go = function(html) { _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) { _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);
} }






Carregando…
Cancelar
Guardar