diff --git a/js/jquery.fn.gantt.js b/js/jquery.fn.gantt.js index 4629ffc..3517123 100644 --- a/js/jquery.fn.gantt.js +++ b/js/jquery.fn.gantt.js @@ -931,7 +931,7 @@ // **Progress Bar** // Return an element representing a progress of position within // the entire chart - createProgressBar: function (days, cls, desc, label, dataObj) { + createProgressBar: function (days, cls, clsh, desc, label, dataObj) { var cellWidth = tools.getCellSize(); var barMarg = tools.getProgressBarMargin() || 0; var bar = $('
') @@ -944,7 +944,7 @@ if (desc) { bar .mouseover(function (e) { - var hint = $('').html(desc); + var hint = $('').addClass(clsh).html(desc); $("body").append(hint); hint.css("left", e.pageX); hint.css("top", e.pageY); @@ -1024,6 +1024,7 @@ _bar = core.createProgressBar( dl, day.customClass ? day.customClass : "", + day.customHintClass ? day.customHintClass : "", day.desc ? day.desc : "", day.label ? day.label : "", day.dataObj ? day.dataObj : null @@ -1067,6 +1068,7 @@ _bar = core.createProgressBar( dl, day.customClass ? day.customClass : "", + day.customHintClass ? day.customHintClass : "", day.desc ? day.desc : "", day.label ? day.label : "", day.dataObj ? day.dataObj : null @@ -1107,6 +1109,7 @@ _bar = core.createProgressBar( dl, day.customClass ? day.customClass : "", + day.customHintClass ? day.customHintClass : "", day.desc ? day.desc : "", day.label ? day.label : "", day.dataObj ? day.dataObj : null @@ -1133,6 +1136,7 @@ _bar = core.createProgressBar( dl, day.customClass ? day.customClass : "", + day.customHintClass ? day.customHintClass : "", day.desc ? day.desc : "", day.label ? day.label : "", day.dataObj ? day.dataObj : null diff --git a/js/jquery.fn.gantt.min.js b/js/jquery.fn.gantt.min.js index 6964536..6a8cbad 100644 --- a/js/jquery.fn.gantt.min.js +++ b/js/jquery.fn.gantt.min.js @@ -17,4 +17,4 @@ // } // }); // -/*jshint shadow:true, laxbreak:true, jquery:true, strict:true, trailing:true */(function(a,b){"use strict",a.fn.gantt=function(c){function g(a,b){for(var c=1;;c++){var d=new Date(a);d.setHours(a.getHours()+b*c);if(d.getTime()!==a.getTime())return d}}var d="jquery.fn.gantt",e=["hours","days","weeks","months"],f={source:[],itemsPerPage:7,months:["January","February","March","April","May","June","July","August","September","October","November","December"],dow:["S","M","T","W","T","F","S"],navigate:"buttons",scale:"days",useCookie:!1,maxScale:"months",minScale:"hours",waitText:"Please wait...",onItemClick:function(a){return},onAddClick:function(a){return},onRender:function(){return},scrollToToday:!0};c&&a.extend(f,c),f.useCookie=f.useCookie&&a.isFunction(a.cookie),a.extend(a.expr[":"],{findday:function(b,c,d){var e=new Date(parseInt(d[3],10)),f=a(b).attr("id");f=f?f:"";var g=f.indexOf("-")+1,h=new Date(parseInt(f.substring(g,f.length),10));return e=new Date(e.getFullYear(),e.getMonth(),e.getDate()),h=new Date(h.getFullYear(),h.getMonth(),h.getDate()),e.getTime()===h.getTime()}}),a.extend(a.expr[":"],{findweek:function(b,c,d){var e=new Date(parseInt(d[3],10)),f=a(b).attr("id");f=f?f:"";var g=f.indexOf("-")+1;e=e.getFullYear()+"-"+e.getDayForWeek().getWeekOfYear();var h=f.substring(g,f.length);return e===h}}),a.extend(a.expr[":"],{findmonth:function(b,c,d){var e=new Date(parseInt(d[3],10));e=e.getFullYear()+"-"+e.getMonth();var f=a(b).attr("id");f=f?f:"";var g=f.indexOf("-")+1,h=f.substring(g,f.length);return e===h}}),Date.prototype.getWeekId=function(){var a=this.getFullYear(),b=this.getDayForWeek().getWeekOfYear(),c=this.getMonth();return c===11&&b===1&&a++,"dh-"+a+"-"+b},Date.prototype.getRepDate=function(){switch(f.scale){case"hours":return this.getTime();case"weeks":return this.getDayForWeek().getTime();case"months":return(new Date(this.getFullYear(),this.getMonth(),1)).getTime();default:return this.getTime()}},Date.prototype.getDayOfYear=function(){var a=new Date(this.getFullYear(),0,0),b=new Date(this.getFullYear(),this.getMonth(),this.getDate());return Math.ceil((b-a)/864e5)},Date.prototype.getWeekOfYear=function(){var a=new Date(this.getFullYear(),0,1),b=new Date(this.getFullYear(),this.getMonth(),this.getDate());a.getDay()>3&&(a=new Date(b.getFullYear(),0,7-a.getDay()));var c=b.getDayOfYear()-a.getDayOfYear();return Math.ceil(c/7)},Date.prototype.getDaysInMonth=function(){return 32-(new Date(this.getFullYear(),this.getMonth(),32)).getDate()},Date.prototype.hasWeek=function(){var a=new Date(this.valueOf());a.setDate(a.getDate()-a.getDay());var b=new Date(this.valueOf());return b.setDate(b.getDate()+(6-b.getDay())),a.getMonth()===b.getMonth()?!0:a.getMonth()===this.getMonth()&&b.getDate()<4||a.getMonth()!==this.getMonth()&&b.getDate()>=4},Date.prototype.getDayForWeek=function(){var a=new Date(this.valueOf());a.setDate(a.getDate()-a.getDay());var b=new Date(this.valueOf());return b.setDate(b.getDate()+(6-b.getDay())),a.getMonth()===b.getMonth()||a.getMonth()!==b.getMonth()&&b.getDate()>=4?new Date(b.setDate(b.getDate()-3)):new Date(a.setDate(a.getDate()+3))};var h={elementFromPoint:function(){return document.compatMode==="CSS1Compat"?function(a,b){return a-=window.pageXOffset,b-=window.pageYOffset,document.elementFromPoint(a,b)}:function(b,c){return b-=a(document).scrollLeft(),c-=a(document).scrollTop(),document.elementFromPoint(b,c)}}(),create:function(b){typeof f.source!="string"?(b.data=f.source,h.init(b)):a.getJSON(f.source,function(a){b.data=a,h.init(b)})},init:function(a){a.rowsNum=a.data.length,a.pageCount=Math.ceil(a.rowsNum/f.itemsPerPage),a.rowsOnLastPage=a.rowsNum-Math.floor(a.rowsNum/f.itemsPerPage)*f.itemsPerPage,a.dateStart=i.getMinDate(a),a.dateEnd=i.getMaxDate(a),h.waitToggle(a,!0,function(){h.render(a)})},render:function(b){var c=a(''),d=h.leftPanel(b);c.append(d);var e=h.rightPanel(b,d),g,i;c.append(e),c.append(h.navigation(b));var j=e.find(".dataPanel");b.gantt=a('').append(c),a(b).empty().append(b.gantt),b.scrollNavigation.panelMargin=parseInt(j.css("margin-left").replace("px",""),10),b.scrollNavigation.panelMaxPos=j.width()-e.width(),b.scrollNavigation.canScroll=j.width()>e.width(),h.markNow(b),h.fillData(b,j,d);if(f.useCookie){var k=a.cookie(this.cookieKey+"ScrollPos");k&&(b.hPosition=k)}f.scrollToToday?(h.navigateTo(b,"now"),h.scrollPanel(b,0)):(b.hPosition!==0&&(b.scaleOldWidth?(g=j.width()-e.width(),i=g*b.hPosition/b.scaleOldWidth,i=i>0?0:i,j.css({"margin-left":i+"px"}),b.scrollNavigation.panelMargin=i,b.hPosition=i,b.scaleOldWidth=null):(j.css({"margin-left":b.hPosition+"px"}),b.scrollNavigation.panelMargin=b.hPosition)),h.repositionLabel(b)),j.css({height:d.height()}),h.waitToggle(b,!1),f.onRender()},leftPanel:function(b){var c=a('').append(a('').css("height",i.getCellSize()*b.headerRows+"px").css("width","100%")),d=[];return a.each(b.data,function(a,c){a>=b.pageNum*f.itemsPerPage&&a