Load Room Now Sets Button Status
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -6,5 +6,5 @@
|
||||
/tables/*
|
||||
/Properties/
|
||||
/.idea/
|
||||
/wwwroot/scripts/js/*.js
|
||||
/wwwroot/scripts/js/*
|
||||
/wwwroot/styles/css/*
|
||||
|
||||
@@ -35,8 +35,6 @@ const setupFloorplanEvents = () => {
|
||||
};
|
||||
const roomButtonClicked = (e) => {
|
||||
const button = $(e.target);
|
||||
$('.roomButton').removeClass('active');
|
||||
button.addClass('active');
|
||||
const roomId = button.data('value');
|
||||
loadRoom(getRoomById(roomId));
|
||||
};
|
||||
@@ -69,6 +67,9 @@ const setupFloorplan = (floorplanData) => {
|
||||
const loadRoom = (roomToLoad) => {
|
||||
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));
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -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))
|
||||
|
||||
@@ -76,6 +76,7 @@
|
||||
#decorator
|
||||
@include flex-column
|
||||
@include absoluteCenter
|
||||
display: none
|
||||
border: solid 3px var(--global-border-color)
|
||||
background-color: var(--global-bgcolor)
|
||||
width: 30vw
|
||||
|
||||
Reference in New Issue
Block a user