From 4123078a82b58a3a3e067549998667f4f9de5e1c Mon Sep 17 00:00:00 2001 From: Xavier ALT Date: Thu, 22 Mar 2012 12:35:12 +0100 Subject: [PATCH 1/2] [FIX] web_calendar: ensure dhtmlx minical does not set offsetHeight < 0px, IE<9 raise 'Invalid argument.' breaking the view bzr revid: xal@openerp.com-20120322113512-092n348lrueg2ave --- .../lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_minical.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_minical.js b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_minical.js index 5bf564980f9..b7b0ba1d21d 100644 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_minical.js +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_minical.js @@ -13,7 +13,7 @@ scheduler._render_calendar=function(b,c,a,d){var e=scheduler.templates,f=this._c g.innerHTML="
"+l.innerHTML+"
";g.childNodes[0].innerHTML=this.templates.calendar_month(c);if(a.navigation){var h=document.createElement("DIV");h.className="dhx_cal_prev_button";h.style.cssText="left:1px;top:2px;position:absolute;";h.innerHTML=this._mini_cal_arrows[0];g.firstChild.appendChild(h);h.onclick=function(){scheduler.updateCalendar(g,scheduler.date.add(g._date,-1,"month"));scheduler._date.getMonth()== g._date.getMonth()&&scheduler._date.getFullYear()==g._date.getFullYear()&&scheduler._markCalendarCurrentDate(g)};h=document.createElement("DIV");h.className="dhx_cal_next_button";h.style.cssText="left:auto; right:1px;top:2px;position:absolute;";h.innerHTML=this._mini_cal_arrows[1];g.firstChild.appendChild(h);h.onclick=function(){scheduler.updateCalendar(g,scheduler.date.add(g._date,1,"month"));scheduler._date.getMonth()==g._date.getMonth()&&scheduler._date.getFullYear()==g._date.getFullYear()&&scheduler._markCalendarCurrentDate(g)}}g._date= new Date(c);g.week_start=(c.getDay()-(this.config.start_on_monday?1:0)+7)%7;var u=this.date.week_start(c);this._reset_month_scale(g.childNodes[2],c,u);for(var j=g.childNodes[2].firstChild.rows,q=j.length;q<6;q++){var t=j[j.length-1];j[0].parentNode.appendChild(t.cloneNode(!0));for(var r=parseInt(t.childNodes[t.childNodes.length-1].childNodes[0].innerHTML),r=r<10?r:0,s=0;s500))b=this._def_count.firstChild;if(b&&(b.onclick=null,b.innerHTML="",b.parentNode&&b.parentNode.removeChild(b),this._def_count))this._def_count.style.top="-1000px"};scheduler.isCalendarVisible=function(){return this._def_count&&parseInt(this._def_count.style.top,10)>0?this._def_count:!1}; scheduler.attachEvent("onTemplatesReady",function(){dhtmlxEvent(document.body,"click",function(){scheduler.destroyCalendar()})});scheduler.templates.calendar_time=scheduler.date.date_to_str("%d-%m-%Y"); scheduler.form_blocks.calendar_time={render:function(){var b="",c=scheduler.config,a=this.date.date_part(new Date);c.first_hour&&a.setHours(c.first_hour);b+=" ";var f=scheduler.config.full_day;return"
"+ From be890ed69139aa7b7de8057fe1e9bca20b30378d Mon Sep 17 00:00:00 2001 From: Xavier ALT Date: Thu, 29 Mar 2012 13:08:39 +0200 Subject: [PATCH 2/2] [FIX] web_calendar: update non-minified version of 'dhtmlxscheduler_minical' to fix offsetHeight < 0px bzr revid: xal@openerp.com-20120329110839-3jvur9msnwwl7exu --- .../static/lib/dhtmlxScheduler/sources/ext/ext_minical.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/ext_minical.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/ext_minical.js index a6a02b96445..78422625765 100644 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/ext_minical.js +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/ext_minical.js @@ -207,7 +207,7 @@ scheduler._render_calendar=function(obj,sd,conf, previous){ if (!previous) obj.appendChild(d); - d.childNodes[1].style.height = (d.childNodes[1].childNodes[0].offsetHeight-1)+"px"; // dhx_year_week should have height property so that day dates would get correct position. dhx_year_week height = height of it's child (with the day name) + d.childNodes[1].style.height = g.childNodes[1].childNodes[0].offsetHeight <= 0 ? "0px" : (d.childNodes[1].childNodes[0].offsetHeight-1)+"px"; // dhx_year_week should have height property so that day dates would get correct position. dhx_year_week height = height of it's child (with the day name) /*restore*/ this._cols=temp; this._mode = temp2; this._colsS = temp3; this._min_date=temp4; this._max_date=temp5; scheduler._date = temp6; ts.month_day=temp7; return d;