mirror of
https://github.com/beestat/app.git
synced 2025-07-09 03:04:07 -04:00
Fixed floor plans not centering on first load.
This commit is contained in:
parent
81168bb7f0
commit
6736326f20
@ -59,7 +59,7 @@
|
||||
"sort-keys": "off",
|
||||
"space-before-function-paren": ["error", "never"],
|
||||
"strict": "off",
|
||||
"valid-jsdoc": ["error", {"requireReturn": false, "requireParamDescription": false}],
|
||||
"valid-jsdoc": ["error", {"requireReturn": false, "requireParamDescription": false, "requireReturnDescription": false}],
|
||||
"vars-on-top": "off",
|
||||
"operator_assignment": "off",
|
||||
|
||||
|
@ -5,6 +5,7 @@
|
||||
*/
|
||||
beestat.component.card.floor_plan_editor = function(thermostat_id) {
|
||||
const self = this;
|
||||
|
||||
this.thermostat_id_ = thermostat_id;
|
||||
|
||||
var change_function = beestat.debounce(function() {
|
||||
@ -36,12 +37,12 @@ beestat.component.card.floor_plan_editor = function(thermostat_id) {
|
||||
}
|
||||
|
||||
// The first time this component renders center the content.
|
||||
if (self.floor_plan_ !== undefined) {
|
||||
this.addEventListener('render', function() {
|
||||
self.floor_plan_.center_content();
|
||||
self.removeEventListener('render');
|
||||
if (this.floor_plan_ !== undefined) {
|
||||
self.floor_plan_.center_content();
|
||||
self.removeEventListener('render');
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
beestat.extend(beestat.component.card.floor_plan_editor, beestat.component.card);
|
||||
|
||||
|
@ -943,7 +943,6 @@ beestat.component.floor_plan.prototype.get_group_below = function(group) {
|
||||
* Center the view box on the content. Sets zoom and pan.
|
||||
*/
|
||||
beestat.component.floor_plan.prototype.center_content = function() {
|
||||
window.fp = this;
|
||||
const floor_plan = beestat.cache.floor_plan[this.floor_plan_id_];
|
||||
|
||||
let min_x = Infinity;
|
||||
|
Loading…
x
Reference in New Issue
Block a user