diff --git a/calendar/js/app.js b/calendar/js/app.js index 85fd746146..93dbfa7116 100644 --- a/calendar/js/app.js +++ b/calendar/js/app.js @@ -3219,23 +3219,27 @@ app.classes.calendar = AppJS.extend( var preferred_width = $j('#calendar-sidebox_date .ui-datepicker-inline').outerWidth(); var font_ratio = 12 / parseFloat($j('#calendar-sidebox_date .ui-datepicker-inline').css('font-size')); $j(window).on('resize.calendar'+date_widget.dom_id, function() { - var percent = 1+(($j(date_widget.getDOMNode()).width() - preferred_width) / preferred_width); - percent *= font_ratio; - $j('#calendar-sidebox_date .ui-datepicker-inline') - .css('font-size',(percent*100)+'%'); + try { + var percent = 1+(($j(date_widget.getDOMNode()).width() - preferred_width) / preferred_width); + percent *= font_ratio; + $j('#calendar-sidebox_date .ui-datepicker-inline') + .css('font-size',(percent*100)+'%'); - // Position go and today - var buttons = $j('#calendar-sidebox_date .ui-datepicker-header a span'); - if(today.length && go_button.length) - { - go_button.position({my: 'left+15px center', at: 'right center-1',of: $j('#calendar-sidebox_date .ui-datepicker-year')}); - today.css({ - 'left': (buttons.first().offset().left + buttons.last().offset().left)/2 - Math.ceil(today.outerWidth(true)/2), - 'top': go_button.css('top') - }); + // Position go and today + var buttons = $j('#calendar-sidebox_date .ui-datepicker-header a span'); + if(today.length && go_button.length) + { + go_button.position({my: 'left+15px center', at: 'right center-1',of: $j('#calendar-sidebox_date .ui-datepicker-year')}); + today.css({ + 'left': (buttons.first().offset().left + buttons.last().offset().left)/2 - Math.ceil(today.outerWidth(true)/2), + 'top': go_button.css('top') + }); + } + } catch (e){ + // Resize didn't work } }).trigger('resize'); - + } // Avoid wrapping owner icons if user has group + search diff --git a/calendar/js/et2_widget_timegrid.js b/calendar/js/et2_widget_timegrid.js index a07e1c56cd..fe7bfff3df 100644 --- a/calendar/js/et2_widget_timegrid.js +++ b/calendar/js/et2_widget_timegrid.js @@ -1706,9 +1706,6 @@ var et2_calendar_timegrid = et2_calendar_view.extend([et2_IDetachedDOM, et2_IRes return; } - // Set the max width to avoid animations screwing up the width - this.div.css('max-width',$j(this.getInstanceManager().DOMContainer).width()); - /* We expect the timegrid to be in a table with 0 or more other timegrids, 1 per row. We want each timegrid to be as large as possible, but space @@ -1775,7 +1772,7 @@ var et2_calendar_timegrid = et2_calendar_view.extend([et2_IDetachedDOM, et2_IRes } // Try to resize width, though animations cause problems - var total_width = this.days.width(); + var total_width = $j(this.getInstanceManager().DOMContainer).parent().innerWidth() - this.days.position().left; var day_width = (total_width > 0 ? total_width : $j(this.getInstanceManager().DOMContainer).width())/this.day_widgets.length; // update day widgets for(var i = 0; i < this.day_widgets.length; i++) diff --git a/etemplate/js/etemplate2.js b/etemplate/js/etemplate2.js index de1a2642d0..0e2f8d46e0 100644 --- a/etemplate/js/etemplate2.js +++ b/etemplate/js/etemplate2.js @@ -148,19 +148,18 @@ etemplate2.prototype.resize = function(e) var appHeader = $j('#divAppboxHeader'); //Calculate the excess height - excess_height = egw(window).is_popup()? $j(window).height() - $j('.et2_container').height() - appHeader.outerHeight()+11: false; + excess_height = egw(window).is_popup()? $j(window).height() - $j(self.DOMContainer).height() - appHeader.outerHeight()+11: false; // Recalculate excess height if the appheader is shown if (appHeader.length > 0 && appHeader.is(':visible')) excess_height -= appHeader.outerHeight()-9; // Do not resize if the template height is bigger than screen available height // For templates which have sub templates and they are bigger than screenHeight - if(screen.availHeight < $j('.et2_container').height()) excess_height = 0; + if(screen.availHeight < $j(self.DOMContainer).height()) excess_height = 0; // Call the "resize" event of all functions which implement the // "IResizeable" interface self.widgetContainer.iterateOver(function(_widget) { - - if (excess_height != 0 || excess_height === false) _widget.resize(excess_height); + _widget.resize(excess_height); }, self, et2_IResizeable); } },100);