Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: dhtmlx/dhtmlxGantt/sources/dhtmlxgantt.js
- ===================================================================
- --- dhtmlx.orig/dhtmlxGantt/sources/dhtmlxgantt.js 2012-06-12 13:49:29.542481180 +0200
- +++ dhtmlx/dhtmlxGantt/sources/dhtmlxgantt.js 2012-06-12 13:59:50.909197607 +0200
- @@ -356,7 +356,9 @@
- //settings
- this.heightTaskItem = 12;
- + this.defaultDayInPixels = 24;
- this.dayInPixels = 24;
- + this.showDayNumbers = true;
- this.hoursInDay = 8;
- this._showTreePanel = true;
- this._showTooltip = true;
- @@ -456,6 +458,30 @@
- this.savePath = newPath;
- };
- /**
- + * @desc: Set the number of pixels per day (horizontal zoom). This will also affect showDayNumbers
- + * @param: pixelsPerDay
- + * @type: public
- + * @before_init: 1
- + */
- +GanttChart.prototype.setPixelsPerDay = function(numPixels)
- +{
- + this.dayInPixels = numPixels;
- + if(this.dayInPixels < 16)
- + this.showDayNumbers = false;
- + else
- + this.showDayNumbers = true;
- +}
- +/**
- + * @desc: Enables / disables displaying the day numbers
- + * @param: showDayNumbers
- + * @type: public
- + * @before_init: 1
- + */
- +GanttChart.prototype.setShowDayNumbers = function(showDayNumbers)
- +{
- + this.showDayNumbers = showDayNumbers;
- +}
- +/**
- * @desc: set url which is used to load chart data with loadData() method
- * @param: newPath - url to server script.
- * @type: public
- @@ -2405,9 +2431,12 @@
- divTasks.className = "taskPanel";
- divTasks.style.cssText = "position:relative;";
- divTasks.style.height = this.contentHeight - 63 + "px";
- + var bgWidth = 168 * (this.dayInPixels / this.defaultDayInPixels) + "px";
- + var bgHeight = "46px"; // The height of bg_week.png
- var w = this.startDate ? (this.startDate.getDay()-1) : ((new Date(0)).getDay()-1);
- if (w==-1) w=6;
- - divTasks.style.background = "url(" + this.imgs + "bg_week.png) -"+(w*24)+"px 0px";
- + divTasks.style.background = "url(" + this.imgs + "bg_week.png) -"+(w*this.dayInPixels)+"px 0px";
- + divTasks.style.backgroundSize = bgWidth + " " + bgHeight;
- this.panelTasks = divTasks;
- return divTasks;
- };
- @@ -2578,7 +2607,8 @@
- date.setDate(date.getDate() + parseInt(idx));
- var day = date.getDate()
- - newCell.innerHTML = day;
- + if (this.showDayNumbers)
- + newCell.innerHTML = day;
- newCell.setAttribute("idx", idx);
- var monthRow = row.parentNode.parentNode.rows[0];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement