1
0
mirror of https://github.com/beestat/app.git synced 2025-07-09 03:04:07 -04:00

Fixed rooms not deselecting when clicking outside of them on a previous floor room

This commit is contained in:
Jon Ziebell 2022-08-05 12:04:47 -04:00
parent c2006a7975
commit 7ac646463f

View File

@ -195,7 +195,6 @@ beestat.component.floor_plan.prototype.add_grid_ = function() {
grid_large_pattern.appendChild(grid_large_path);
const grid_rect = document.createElementNS('http://www.w3.org/2000/svg', 'rect');
grid_rect.setAttribute('id', 'grid_rect');
grid_rect.setAttribute('x', this.grid_pixels_ / -2);
grid_rect.setAttribute('y', this.grid_pixels_ / -2);
grid_rect.setAttribute('width', this.grid_pixels_);
@ -264,7 +263,7 @@ beestat.component.floor_plan.prototype.set_draggable_ = function() {
this.mouseup_handler_ = function(e) {
// Deselect when clicking on the background.
if (
e.target.getAttribute('id') === 'grid_rect' &&
self.parent_.contains(e.target) &&
e.clientX === self.drag_start_mouse_.x &&
e.clientY === self.drag_start_mouse_.y
) {