Код: Выделить всё
showIn(calendar) {
if (
this.date < dateString(calendar.weekStart) ||
this.date > dateString(calendar.weekEnd)
) {
$(`#${this.id}`).remove();
return;
}
let eventSlot;
if ($(`#${this.id}`).length) {
eventSlot = $(`#${this.id}`);
} else {
eventSlot = $("")
.addClass("event")
.attr("id", this.id)
.click(() => this.clickIn(calendar));
}
let textoutput = this.sus + "-" + this.description;
eventSlot
.text(textoutput)
.css("backgroundColor", `var(--color-${this.color})`)
.css("white-space", "nowrap")
.css("position", "relative")
.appendTo(`.day[data-dayIndex=${this.dayIndex}] .slot[data-hour=${this.startHour}]`);
}
Код: Выделить всё
let textoutput = this.sus + "-" + this.description;
eventSlot
.text(textoutput)
Подробнее здесь: https://stackoverflow.com/questions/784 ... javascript
Мобильная версия