Bugfixes
This commit is contained in:
parent
06e73365a9
commit
36bdad8036
5 changed files with 29 additions and 2 deletions
|
@ -24,6 +24,7 @@ class Calendar(calendar: HTMLElement) : View(calendar) {
|
|||
private val htmlBody = document.body ?: createHtmlView()
|
||||
|
||||
val day = calendarTable.dataset["day"]?.toIntOrNull() ?: -1
|
||||
val reloadOnFinish = calendarTable.dataset["reload"]?.toBoolean() ?: false
|
||||
val referenceDate = calendarTable.dataset["reference"]?.toLongOrNull() ?: -1L
|
||||
val nowDate = calendarTable.dataset["now"]?.toLongOrNull() ?: -1L
|
||||
val timeDifference = Date.now().toLong() - nowDate
|
||||
|
|
|
@ -10,6 +10,7 @@ import org.w3c.dom.HTMLElement
|
|||
import org.w3c.dom.INSTANT
|
||||
import org.w3c.dom.SMOOTH
|
||||
import org.w3c.dom.ScrollBehavior
|
||||
import kotlin.browser.window
|
||||
import kotlin.js.Date
|
||||
import kotlin.math.max
|
||||
import kotlin.math.min
|
||||
|
@ -97,7 +98,10 @@ class CalendarBody(val calendar: Calendar, view: HTMLElement) : ViewCollection<C
|
|||
|
||||
var activeRow: CalendarRow? = null
|
||||
|
||||
var largestRowTime = Int.MIN_VALUE
|
||||
|
||||
for (row in this) {
|
||||
largestRowTime = max(largestRowTime, row.time)
|
||||
if (row.time == rowTime) {
|
||||
row.classList.clear()
|
||||
for (str in row.classList) {
|
||||
|
@ -118,6 +122,10 @@ class CalendarBody(val calendar: Calendar, view: HTMLElement) : ViewCollection<C
|
|||
}
|
||||
}
|
||||
|
||||
if (largestRowTime < currentTime && calendar.reloadOnFinish) {
|
||||
window.location.reload()
|
||||
}
|
||||
|
||||
if (calendar.autoScroll && activeRow != null) {
|
||||
if (calendar.orientation == Calendar.Orientation.ROOM_TO_TIME) {
|
||||
calendar.scrollVerticalTo((activeRow.offsetTop - 150).toDouble(), scroll)
|
||||
|
|
|
@ -119,6 +119,21 @@
|
|||
border-bottom: none;
|
||||
}
|
||||
|
||||
& > div {
|
||||
flex-grow: 0;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.board-schedule-name {
|
||||
flex-grow: 1 !important;
|
||||
flex-shrink: 1 !important;
|
||||
}
|
||||
|
||||
.board-schedule-room {
|
||||
flex-grow: 1 !important;
|
||||
flex-shrink: 1 !important;
|
||||
}
|
||||
|
||||
.board-schedule-clock {
|
||||
position: absolute;
|
||||
left: 1rem;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue