Просмотр исходного кода

fix agenda selection alignment when cell height is customized (issue 1035)

Adam Shaw 12 лет назад
Родитель
Сommit
bc0883f8f0
1 измененных файлов с 3 добавлено и 3 удалено
  1. 3 3
      src/agenda/AgendaView.js

+ 3 - 3
src/agenda/AgendaView.js

@@ -98,7 +98,6 @@ function AgendaView(element, calendar, viewName) {
 	var slotContainer;
 	var slotSegmentContainer;
 	var slotTable;
-	var slotTableFirstInner;
 	var selectionHelper;
 	
 	var viewWidth;
@@ -263,7 +262,6 @@ function AgendaView(element, calendar, viewName) {
 			"</tbody>" +
 			"</table>";
 		slotTable = $(s).appendTo(slotContainer);
-		slotTableFirstInner = slotTable.find('div:first');
 		
 		slotBind(slotTable.find('td'));
 	}
@@ -447,7 +445,9 @@ function AgendaView(element, calendar, viewName) {
 		
 		slotScroller.height(bodyHeight - allDayHeight - 1);
 		
-		slotHeight = slotTableFirstInner.height() + 1; // +1 for border
+		// the stylesheet guarantees that the first row has no border.
+		// this allows .height() to work well cross-browser.
+		slotHeight = slotTable.find('tr:first').height() + 1; // +1 for bottom border
 
 		snapRatio = opt('slotMinutes') / snapMinutes;
 		snapHeight = slotHeight / snapRatio;