Load Room Now Sets Button Status
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -6,5 +6,5 @@
|
|||||||
/tables/*
|
/tables/*
|
||||||
/Properties/
|
/Properties/
|
||||||
/.idea/
|
/.idea/
|
||||||
/wwwroot/scripts/js/*.js
|
/wwwroot/scripts/js/*
|
||||||
/wwwroot/styles/css/*
|
/wwwroot/styles/css/*
|
||||||
|
|||||||
@@ -35,8 +35,6 @@ const setupFloorplanEvents = () => {
|
|||||||
};
|
};
|
||||||
const roomButtonClicked = (e) => {
|
const roomButtonClicked = (e) => {
|
||||||
const button = $(e.target);
|
const button = $(e.target);
|
||||||
$('.roomButton').removeClass('active');
|
|
||||||
button.addClass('active');
|
|
||||||
const roomId = button.data('value');
|
const roomId = button.data('value');
|
||||||
loadRoom(getRoomById(roomId));
|
loadRoom(getRoomById(roomId));
|
||||||
};
|
};
|
||||||
@@ -69,6 +67,9 @@ const setupFloorplan = (floorplanData) => {
|
|||||||
const loadRoom = (roomToLoad) => {
|
const loadRoom = (roomToLoad) => {
|
||||||
setRoomBackground(roomToLoad);
|
setRoomBackground(roomToLoad);
|
||||||
setupKonva();
|
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 tablesInRoom = Floorplan.tables.filter(table => table.room_id == roomToLoad.id);
|
||||||
const decorationsInRoom = Floorplan.decorations.filter(decoration => decoration.decoration_room == roomToLoad.id);
|
const decorationsInRoom = Floorplan.decorations.filter(decoration => decoration.decoration_room == roomToLoad.id);
|
||||||
decorationsInRoom.forEach(decoration => createDecorationShape(decoration, false));
|
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 roomButtonClicked = (e: Event) => {
|
||||||
const button = $(e.target)
|
const button = $(e.target)
|
||||||
$('.roomButton').removeClass('active')
|
|
||||||
button.addClass('active')
|
|
||||||
const roomId = button.data('value')
|
const roomId = button.data('value')
|
||||||
loadRoom(getRoomById(roomId))
|
loadRoom(getRoomById(roomId))
|
||||||
}
|
}
|
||||||
@@ -114,6 +112,10 @@ const loadRoom = (roomToLoad: room) => {
|
|||||||
setRoomBackground(roomToLoad)
|
setRoomBackground(roomToLoad)
|
||||||
setupKonva()
|
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 tablesInRoom = Floorplan.tables.filter(table => table.room_id == roomToLoad.id)
|
||||||
const decorationsInRoom = Floorplan.decorations.filter(decoration => decoration.decoration_room == roomToLoad.id)
|
const decorationsInRoom = Floorplan.decorations.filter(decoration => decoration.decoration_room == roomToLoad.id)
|
||||||
decorationsInRoom.forEach(decoration => createDecorationShape(decoration, false))
|
decorationsInRoom.forEach(decoration => createDecorationShape(decoration, false))
|
||||||
|
|||||||
@@ -76,6 +76,7 @@
|
|||||||
#decorator
|
#decorator
|
||||||
@include flex-column
|
@include flex-column
|
||||||
@include absoluteCenter
|
@include absoluteCenter
|
||||||
|
display: none
|
||||||
border: solid 3px var(--global-border-color)
|
border: solid 3px var(--global-border-color)
|
||||||
background-color: var(--global-bgcolor)
|
background-color: var(--global-bgcolor)
|
||||||
width: 30vw
|
width: 30vw
|
||||||
|
|||||||
Reference in New Issue
Block a user