From 5dcb667e83325837f1fb7928753fa77e28334c69 Mon Sep 17 00:00:00 2001 From: Peter Date: Mon, 30 Jun 2014 09:56:26 +0200 Subject: [PATCH 1/3] Custom classes for gant-hint Add the possibility to add a custom classes for the item hint --- js/jquery.fn.gantt.js | 69 +++++++++++++++++++++++-------------------- 1 file changed, 37 insertions(+), 32 deletions(-) diff --git a/js/jquery.fn.gantt.js b/js/jquery.fn.gantt.js index 4629ffc..8592d32 100644 --- a/js/jquery.fn.gantt.js +++ b/js/jquery.fn.gantt.js @@ -43,7 +43,7 @@ waitText: "Please wait...", onItemClick: function (data) { return; }, onAddClick: function (data) { return; }, - onRender: function() { return; }, + onRender: function () { return; }, scrollToToday: true }; @@ -185,7 +185,7 @@ // fixes https://github.com/taitems/jQuery.Gantt/issues/62 function ktkGetNextDate(currentDate, scaleStep) { - for(var minIncrements = 1;; minIncrements++) { + for (var minIncrements = 1; ; minIncrements++) { var nextDate = new Date(currentDate); nextDate.setHours(currentDate.getHours() + scaleStep * minIncrements); @@ -205,7 +205,7 @@ var core = { // Return the element whose topmost point lies under the given point // Normalizes for old browsers - elementFromPoint: (function(){ // IIFE + elementFromPoint: (function () { // IIFE // version for normal browsers if (document.compatMode === "CSS1Compat") { return function (x, y) { @@ -291,7 +291,7 @@ if (settings.scrollToToday) { core.navigateTo(element, 'now'); core.scrollPanel(element, 0); - // or, scroll the grid to the left most date in the panel + // or, scroll the grid to the left most date in the panel } else { if (element.hPosition !== 0) { if (element.scaleOldWidth) { @@ -490,7 +490,7 @@ day_class = "holiday"; } if (rgetDay !== getDay) { - var day_class2 = (today - day === 0) ? "today" : tools.isHoliday( day.getTime() ) ? "holiday" : dowClass[getDay]; + var day_class2 = (today - day === 0) ? "today" : tools.isHoliday(day.getTime()) ? "holiday" : dowClass[getDay]; dayArr.push('
' @@ -530,7 +530,7 @@ var day_class = dowClass[day.getDay()]; - if ( tools.isHoliday(day) ) { + if (tools.isHoliday(day)) { day_class = "holiday"; } @@ -554,7 +554,7 @@ break; - // **Weeks** + // **Weeks** case "weeks": range = tools.parseWeeksRange(element.dateStart, element.dateEnd); yearArr = ['
']; @@ -619,7 +619,7 @@ break; - // **Months** + // **Months** case 'months': range = tools.parseMonthsRange(element.dateStart, element.dateEnd); @@ -670,7 +670,7 @@ break; - // **Days (default)** + // **Days (default)** default: range = tools.parseDateRange(element.dateStart, element.dateEnd); @@ -710,7 +710,7 @@ var getDay = rday.getDay(); var day_class = dowClass[getDay]; - if ( tools.isHoliday(rday) ) { + if (tools.isHoliday(rday)) { day_class = "holiday"; } @@ -863,7 +863,7 @@ $(document).mouseup(function () { element.scrollNavigation.scrollerMouseDown = false; }); - // Button navigation is provided by setting `settings.navigation='buttons'` + // Button navigation is provided by setting `settings.navigation='buttons'` } else { ganttNavigate = $('