Load Room Now Sets Button Status
This commit is contained in:
@@ -72,8 +72,6 @@ const setupFloorplanEvents = () => {
|
||||
|
||||
const roomButtonClicked = (e: Event) => {
|
||||
const button = $(e.target)
|
||||
$('.roomButton').removeClass('active')
|
||||
button.addClass('active')
|
||||
const roomId = button.data('value')
|
||||
loadRoom(getRoomById(roomId))
|
||||
}
|
||||
@@ -114,6 +112,10 @@ const loadRoom = (roomToLoad: room) => {
|
||||
setRoomBackground(roomToLoad)
|
||||
setupKonva()
|
||||
|
||||
$('.roomButton').removeClass('active')
|
||||
let button = $(`.roomButton[data-value=${roomToLoad.id}]`)
|
||||
button.addClass('active')
|
||||
|
||||
const tablesInRoom = Floorplan.tables.filter(table => table.room_id == roomToLoad.id)
|
||||
const decorationsInRoom = Floorplan.decorations.filter(decoration => decoration.decoration_room == roomToLoad.id)
|
||||
decorationsInRoom.forEach(decoration => createDecorationShape(decoration, false))
|
||||
|
||||
Reference in New Issue
Block a user