Change to background image loader

This commit is contained in:
2022-02-27 11:57:52 +10:00
parent 05a1a71e6b
commit cc7d06e78b

View File

@@ -615,7 +615,7 @@ const setRoomBackground = (roomToLoad: room) => {
const width = Floorplan.floorplanDiv.width() const width = Floorplan.floorplanDiv.width()
const height = Floorplan.floorplanDiv.height() const height = Floorplan.floorplanDiv.height()
if(roomToLoad.background_image) { if(roomToLoad.background_image != "") {
Floorplan.floorplanDiv.css("background-image", `url('/images/rooms/${roomToLoad.background_image}')`) Floorplan.floorplanDiv.css("background-image", `url('/images/rooms/${roomToLoad.background_image}')`)
Floorplan.floorplanDiv.css("background-size", `${width}px ${height}px`) Floorplan.floorplanDiv.css("background-size", `${width}px ${height}px`)
} else { } else {