Przeglądaj źródła

renderHeadDateCellHtml accept attribute string

Adam Shaw 10 lat temu
rodzic
commit
1087f68548
1 zmienionych plików z 9 dodań i 4 usunięć
  1. 9 4
      src/common/DayTableMixin.js

+ 9 - 4
src/common/DayTableMixin.js

@@ -290,18 +290,23 @@ var DayTableMixin = FC.DayTableMixin = {
 	},
 
 
-	renderHeadDateCellHtml: function(date, colspan) {
+	// TODO: when internalApiVersion, accept an object for HTML attributes
+	// (colspan should be no different)
+	renderHeadDateCellHtml: function(date, colspan, otherAttrs) {
 		var view = this.view;
 
 		return '' +
 			'<th class="fc-day-header ' + view.widgetHeaderClass + ' fc-' + dayIDs[date.day()] + '"' +
+				(this.rowCnt == 1 ?
+					' data-date="' + date.format('YYYY-MM-DD') + '"' :
+					'') +
 				(colspan > 1 ?
 					' colspan="' + colspan + '"' :
 					'') +
-				(this.rowCnt == 1 ?
-					' data-date="' + date.format('YYYY-MM-DD') + '"' : // if date has a time, won't format it
+				(otherAttrs ?
+					' ' + otherAttrs :
 					'') +
-				'>' +
+			'>' +
 				htmlEscape(date.format(this.colHeadFormat)) +
 			'</th>';
 	},