Attempt to get nextmatch printing always on the page (landscape)

This commit is contained in:
Nathan Gray 2015-02-05 21:52:29 +00:00
parent 166a041e55
commit 2cf897b05a
2 changed files with 22 additions and 3 deletions

View File

@ -1846,6 +1846,13 @@ var et2_nextmatch = et2_DOMWidget.extend([et2_IResizeable, et2_IInput, et2_IPrin
* If they want to print them all, we ask the server and print when they're loaded.
*/
beforePrint: function() {
// Add the class, if needed
this.div.addClass('print');
// Trigger resize, so we can fit on a page
this.dynheight.outerNode.css('max-width',this.div.css('max-width'));
this.resize();
// Check for rows that aren't loaded yet, or lots of rows
var range = this.controller._grid.getIndexRange();
this.old_height = this.controller._grid._scrollHeight;
@ -1957,13 +1964,13 @@ var et2_nextmatch = et2_DOMWidget.extend([et2_IResizeable, et2_IInput, et2_IPrin
return defer;
}
// Don't return anything, just work normally
// Add the class, if needed
this.div.addClass('print');
},
afterPrint: function() {
this.div.removeClass('print');
this.controller._grid.setScrollHeight(this.old_height);
delete this.old_height;
this.dynheight.outerNode.css('max-width','inherit');
this.resize();
}
});
et2_register_widget(et2_nextmatch, ["nextmatch"]);

View File

@ -462,12 +462,21 @@ which caused click on free space infront of a tag stops nm row selection*/
.et2_nextmatch .egwGridView_grid tr td div.et2_vbox a {
display: table-row;
}
/*
These are set via javascript before printing to help tame nextmatch's layout
for printing
*/
.et2_nextmatch.print .egwGridView_scrollarea {
height: auto !important;
width: auto !important;
}
.et2_nextmatch.print > div {
height: auto !important;
}
.et2_nextmatch.print {
/* This is fairly arbitrary, but makes it fit in Chrome and Firefox*/
max-width: 700pt !important;
}
/**
* Diff widget
*/
@ -1129,9 +1138,12 @@ div.message.floating {
-webkit-region-break-inside: avoid;
}
.et2_nextmatch > div {
width: 100% !important;
width: auto !important;
height: auto !important;
}
.et2_nextmatch table.egwGridView_outer thead tr th div.innerContainer {
max-height: inherit;
}
#cke_1_top.cke_top {
display: none;
border:none;