Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/components/datepicker/js/calendarMonthBody.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
monthBodyCtrl.calendarCtrl = calendarCtrl;
monthBodyCtrl.monthCtrl = monthCtrl;
monthBodyCtrl.arrowIcon = ARROW_ICON.cloneNode(true);
monthBodyCtrl.generateContent();

// The virtual-repeat re-uses the same DOM elements, so there are only a limited number
// of repeated items that are linked, and then those elements have their bindings updated.
Expand Down Expand Up @@ -81,8 +80,9 @@
CalendarMonthBodyCtrl.prototype.generateContent = function() {
var date = this.dateUtil.incrementMonths(this.monthCtrl.firstRenderableDate, this.offset);

this.$element.empty();
this.$element.append(this.buildCalendarForMonth(date));
this.$element
.empty()
.append(this.buildCalendarForMonth(date));

if (this.focusAfterAppend) {
this.focusAfterAppend.classList.add(this.calendarCtrl.FOCUSED_DATE_CLASS);
Expand Down
8 changes: 4 additions & 4 deletions src/components/datepicker/js/calendarYearBody.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,9 @@

yearBodyCtrl.calendarCtrl = calendarCtrl;
yearBodyCtrl.yearCtrl = yearCtrl;
yearBodyCtrl.generateContent();

scope.$watch(function() { return yearBodyCtrl.offset; }, function(offset, oldOffset) {
if (offset != oldOffset) {
if (offset !== oldOffset) {
yearBodyCtrl.generateContent();
}
});
Expand Down Expand Up @@ -71,8 +70,9 @@
CalendarYearBodyCtrl.prototype.generateContent = function() {
var date = this.dateUtil.incrementYears(this.yearCtrl.firstRenderableDate, this.offset);

this.$element.empty();
this.$element.append(this.buildCalendarForYear(date));
this.$element
.empty()
.append(this.buildCalendarForYear(date));

if (this.focusAfterAppend) {
this.focusAfterAppend.classList.add(this.calendarCtrl.FOCUSED_DATE_CLASS);
Expand Down