scheduler._reset_scale=function(){ //current mode doesn't support scales //we mustn't call reset_scale for such modes, so it just to be sure if (!this.templates[this._mode+"_date"]) return; if(this._mode == 'week') this._table_view = true; var h=this._els["dhx_cal_header"][0]; var b=this._els["dhx_cal_data"][0]; var c = this.config; h.innerHTML=""; b.scrollTop=0; //fix flickering in FF b.innerHTML=""; var str=((c.readonly||(!c.drag_resize))?" dhx_resize_denied":"")+((c.readonly||(!c.drag_move))?" dhx_move_denied":""); if (str) b.className = "dhx_cal_data"+str; this._cols=[]; //store for data section this._colsS={height:0}; this._dy_shift=0; this.set_sizes(); var summ=parseInt(h.style.width); //border delta var left=0; var d,dd,sd,today; dd=this.date[this._mode+"_start"](new Date(this._date.valueOf())); d=sd=this._table_view?scheduler.date.week_start(dd):dd; today=this.date.date_part(new Date()); //reset date in header var ed=scheduler.date.add(dd,1,this._mode); if(this._mode == 'week') var count = 2; else var count = 7; if (!this._table_view){ var count_n = this.date["get_"+this._mode+"_end"]; if (count_n) ed = count_n(dd); count = Math.round((ed.valueOf()-dd.valueOf())/(1000*60*60*24)); } this._min_date=d; this._els["dhx_cal_date"][0].innerHTML=this.templates[this._mode+"_date"](dd,ed,this._mode); for (var i=0; i "+this.templates.week_scale_date(sd)+"
" sd=this.date.add(sd,1,"day"); if(i==3) break; } html+=""; h[i] = cellheight; cellheight+=this._colsS.height; } html+=""; this._max_date=sd; b.innerHTML=html; return sd; } scheduler._mouse_coords=function(ev){ var pos; var b=document.body; var d = document.documentElement; if(ev.pageX || ev.pageY) pos={x:ev.pageX, y:ev.pageY}; else pos={ x:ev.clientX + (b.scrollLeft||d.scrollLeft||0) - b.clientLeft, y:ev.clientY + (b.scrollTop||d.scrollTop||0) - b.clientTop } //apply layout pos.x-=getAbsoluteLeft(this._obj)+(this._table_view?0:this.xy.scale_width); pos.y-=getAbsoluteTop(this._obj)+this.xy.nav_height+(this._dy_shift||0)+this.xy.scale_height-this._els["dhx_cal_data"][0].scrollTop; pos.ev = ev; var handler = this["mouse_"+this._mode]; if (handler) return handler.call(this,pos); //transform to date if (!this._table_view){ pos.x=Math.max(0,Math.ceil(pos.x/this._cols[0])-1); pos.y=Math.max(0,Math.ceil(pos.y*60/(this.config.time_step*this.config.hour_size_px))-1)+this.config.first_hour*(60/this.config.time_step); } else { var dy=0; for (dy=1; dy < this._colsS.heights.length; dy++) if (this._colsS.heights[dy]>pos.y) break; this._mode == 'week'?n=2:n=7; pos.y=(Math.max(0,Math.ceil(pos.x/this._cols[0])-1)+Math.max(0,dy-1)*n)*24*60/this.config.time_step; pos.x=0; } return pos; } scheduler._pre_render_events=function(evs,hold){ var hb = this.xy.bar_height; var h_old = this._colsS.heights; var h=this._colsS.heights=[0,0,0,0,0,0,0]; if (!this._table_view) evs=this._pre_render_events_line(evs,hold); //ignore long events for now else evs=this._pre_render_events_table(evs,hold); if (this._table_view){ if (hold) this._colsS.heights = h_old; else { var evl = this._els["dhx_cal_data"][0].firstChild; if (evl.rows){ for (var i=0; i this._colsS.height-22){ // 22 - height of cell's header //we have overflow, update heights var cells = evl.rows[i].cells; for (var j=0; j < cells.length; j++) { cells[j].childNodes[1].style.height = h[i]*hb+"px"; } h[i]=(h[i-1]||0)+cells[0].offsetHeight; } h[i]=(h[i-1]||0)+evl.rows[i].cells[0].offsetHeight; } h.unshift(0); if (evl.parentNode.offsetHeight