diff --git a/etemplate/js/et2_extension_nextmatch.js b/etemplate/js/et2_extension_nextmatch.js index 8e6d22b16d..d01f835ba0 100644 --- a/etemplate/js/et2_extension_nextmatch.js +++ b/etemplate/js/et2_extension_nextmatch.js @@ -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"]); diff --git a/etemplate/templates/default/etemplate2.css b/etemplate/templates/default/etemplate2.css index c0688c916c..161ff7024a 100644 --- a/etemplate/templates/default/etemplate2.css +++ b/etemplate/templates/default/etemplate2.css @@ -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;