[eGroupWare-svn] r55777 - in /trunk/calendar: js/et2_widget_timegrid.js templates/default/app.css

[email protected]
Newsgroups gmane.comp.web.egroupware.cvs
Message-ID <[email protected]>
Author: nathangray
Date: Wed Apr 20 00:45:43 2016
New Revision: 55777

URL: http://svn.stylite.de/viewvc/egroupware?rev=55777&view=rev
Log:
Improvements to printing in Firefox

Modified:
    trunk/calendar/js/et2_widget_timegrid.js
    trunk/calendar/templates/default/app.css

Modified: trunk/calendar/js/et2_widget_timegrid.js
URL: http://svn.stylite.de/viewvc/egroupware/trunk/calendar/js/et2_widget_timegrid.js?rev=55777&r1=55776&r2=55777&view=diff
==============================================================================
--- trunk/calendar/js/et2_widget_timegrid.js (original)
+++ trunk/calendar/js/et2_widget_timegrid.js Wed Apr 20 00:45:43 2016
@@ -1885,7 +1885,7 @@
 		{
 			return;
 		}
-		
+
 		// update day widgets
 		var day_width = (100 / this.day_widgets.length);
 		for(var i = 0; i < this.day_widgets.length; i++)
@@ -1902,10 +1902,16 @@
 		// Stop Firefox from scrolling the day to the top - this would break printing in Chrome
 		if (navigator.userAgent.match(/(firefox|safari|iceweasel)/i) && !navigator.userAgent.match(/chrome/i))
 		{
-			this.scrolling.children().css({
-				'transform':'translateY(-'+this.scrolling.scrollTop()+'px)',
-				'overflow': 'visible'
+			var height = this.scrolling.scrollTop() + this.scrolling.height();
+			this.scrolling
+				// Disable scroll event, or it will recalculate out of view events
+				.off('scroll')
+				// Explicitly transform to the correct place
+				.css({
+					'transform': 'translateY(-'+this.scrolling.scrollTop()+'px)',
+					'height': height+'px'
 			});
+			this.div.css('height','');
 		}
 	},
 
@@ -1913,7 +1919,18 @@
 	 * Reset after printing
 	 */
 	afterPrint: function() {
+		this.div.css('maxHeight','');
 		this.scrolling.children().css({'transform':'', 'overflow':''});
+		if (navigator.userAgent.match(/(firefox|safari|iceweasel)/i) && !navigator.userAgent.match(/chrome/i))
+		{
+			this.div.height(this.options.height);
+			this._resizeTimes();
+			this.scrolling
+				// Re-enable out-of-view formatting on scroll
+				.on('scroll', jQuery.proxy(this._scroll, this))
+				// Remove translation
+				.css('transform','');
+		}
 	}
 });}).call(this);
 et2_register_widget(et2_calendar_timegrid, ["calendar-timegrid"]);

Modified: trunk/calendar/templates/default/app.css
URL: http://svn.stylite.de/viewvc/egroupware/trunk/calendar/templates/default/app.css?rev=55777&r1=55776&r2=55777&view=diff
==============================================================================
--- trunk/calendar/templates/default/app.css (original)
+++ trunk/calendar/templates/default/app.css Wed Apr 20 00:45:43 2016
@@ -23,6 +23,9 @@
 	#calendar-view_view > tbody > tr.view_row {
 		page-break-inside: avoid;
 	}
+	.calendar_calTimeGrid {
+		max-height: 18cm;
+	}
 	.calendar_calTimeGrid .calendar_calTimeGridScroll {
 		overflow-y: hidden !important;
 	}


------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.