Browse Source

adjust fc-today to not affect current styling

Adam Shaw 9 years ago
parent
commit
c253b58e10
3 changed files with 12 additions and 7 deletions
  1. 5 1
      src/common/DayTableMixin.js
  2. 6 5
      src/common/Grid.js
  3. 1 1
      src/common/common.css

+ 5 - 1
src/common/DayTableMixin.js

@@ -301,7 +301,11 @@ var DayTableMixin = FC.DayTableMixin = {
 
 		// if only one row of days, the classNames on the header can represent the specific days beneath
 		if (this.rowCnt === 1) {
-			classNames = classNames.concat(this.getDayClasses(date)); // includes the day-of-week class
+			classNames = classNames.concat(
+				// includes the day-of-week class
+				// noThemeHighlight=true (don't highlight the header)
+				this.getDayClasses(date, true)
+			);
 		}
 		else {
 			classNames.push('fc-' + dayIDs[date.day()]); // only add the day-of-week class

+ 6 - 5
src/common/Grid.js

@@ -622,7 +622,7 @@ var Grid = FC.Grid = Class.extend(ListenerMixin, MouseIgnorerMixin, {
 
 
 	// Computes HTML classNames for a single-day element
-	getDayClasses: function(date) {
+	getDayClasses: function(date, noThemeHighlight) {
 		var view = this.view;
 		var today = view.calendar.getNow();
 		var classes = [ 'fc-' + dayIDs[date.day()] ];
@@ -635,10 +635,11 @@ var Grid = FC.Grid = Class.extend(ListenerMixin, MouseIgnorerMixin, {
 		}
 
 		if (date.isSame(today, 'day')) {
-			classes.push(
-				'fc-today',
-				view.highlightStateClass
-			);
+			classes.push('fc-today');
+
+			if (noThemeHighlight !== true) {
+				classes.push(view.highlightStateClass);
+			}
 		}
 		else if (date < today) {
 			classes.push('fc-past');

+ 1 - 1
src/common/common.css

@@ -49,7 +49,7 @@ body .fc { /* extra precedence to overcome jqui */
 	color: #666;
 }
 
-.fc-unthemed .fc-today {
+.fc-unthemed td.fc-today {
 	background: #fcf8e3;
 }