Skip to content

Commit

Permalink
fix createPopup
Browse files Browse the repository at this point in the history
  • Loading branch information
uvarov-frontend committed Aug 27, 2022
1 parent dbe7985 commit fcb1d8f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/vanilla-calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -404,11 +404,12 @@ export default class VanillaCalendar {
for (const day in this.popups) {
if (Object.hasOwnProperty.call(this.popups, day)) {
const dayBtnEl = daysEl.querySelector(`[data-calendar-day="${day}"]`);
if (!dayBtnEl) return;

const dayInfo = this.popups[day];
dayBtnEl.classList.add(dayInfo.modifier);
dayBtnEl.parentNode.innerHTML += `<div class="vanilla-calendar-day__popup">${dayInfo.html}</div>`;
if (dayBtnEl) {
const dayInfo = this.popups[day];
dayBtnEl.classList.add(dayInfo.modifier);
dayBtnEl.parentNode.innerHTML += `<div class="vanilla-calendar-day__popup">${dayInfo.html}</div>`;
}
}
}
}
Expand Down

0 comments on commit fcb1d8f

Please sign in to comment.