Avoid more info dialog jump

This commit is contained in:
Paulus Schoutsen 2017-01-29 23:57:34 -08:00
parent 11caadc516
commit 5792c77100
6 changed files with 31 additions and 24 deletions

View File

@ -92,7 +92,7 @@ Polymer({
return re.test(code);
},
stateObjChanged: function (newVal) {
stateObjChanged: function (newVal, oldVal) {
if (newVal) {
this.codeFormat = newVal.attributes.code_format;
this.codeInputVisible = this.codeFormat !== null;
@ -110,9 +110,11 @@ Polymer({
this.armHomeButtonVisible = newVal.state === 'disarmed';
this.armAwayButtonVisible = newVal.state === 'disarmed';
}
this.async(function () {
this.fire('iron-resize');
}.bind(this), 500);
if (oldval) {
this.async(function () {
this.fire('iron-resize');
}.bind(this), 500);
}
},
handleDisarmTap: function () {

View File

@ -234,7 +234,7 @@ Polymer({
},
},
stateObjChanged: function (newVal) {
stateObjChanged: function (newVal, oldVal) {
this.targetTemperatureSliderValue = newVal.attributes.temperature;
this.awayToggleChecked = newVal.attributes.away_mode === 'on';
this.auxheatToggleChecked = newVal.attributes.aux_heat === 'on';
@ -260,9 +260,11 @@ Polymer({
this.swingIndex = -1;
}
this.async(function () {
this.fire('iron-resize');
}.bind(this), 500);
if (oldVal) {
this.async(function () {
this.fire('iron-resize');
}.bind(this), 500);
}
},
computeTargetTempHidden: function (stateObj) {

View File

@ -85,7 +85,7 @@ Polymer({
},
},
stateObjChanged: function (newVal) {
stateObjChanged: function (newVal, oldVal) {
this.oscillationToggleChecked = newVal.attributes.oscillating;
if (newVal.attributes.speed_list) {
@ -95,9 +95,11 @@ Polymer({
this.speedIndex = -1;
}
this.async(function () {
this.fire('iron-resize');
}.bind(this), 500);
if (oldVal) {
this.async(function () {
this.fire('iron-resize');
}.bind(this), 500);
}
},
computeClassNames: function (stateObj) {

View File

@ -123,7 +123,7 @@ Polymer({
},
},
stateObjChanged: function (newVal) {
stateObjChanged: function (newVal, oldVal) {
if (newVal && newVal.state === 'on') {
this.brightnessSliderValue = newVal.attributes.brightness;
this.ctSliderValue = newVal.attributes.color_temp;
@ -139,9 +139,11 @@ Polymer({
this.brightnessSliderValue = 0;
}
this.async(function () {
this.fire('iron-resize');
}.bind(this), 500);
if (oldVal) {
this.async(function () {
this.fire('iron-resize');
}.bind(this), 500);
}
},
computeClassNames: function (stateObj) {

View File

@ -47,13 +47,10 @@ Polymer({
this.callService('lock', { code: this.enteredCode });
},
stateObjChanged: function (newVal) {
stateObjChanged: function (newVal, oldVal) {
if (newVal) {
this.isLocked = newVal.state === 'locked';
}
this.async(function () {
this.fire('iron-resize');
}.bind(this), 500);
},
callService: function (service, data) {

View File

@ -228,7 +228,7 @@ Polymer({
HAS_MEDIA_STATES: ['playing', 'paused', 'unknown'],
stateObjChanged: function (newVal) {
stateObjChanged: function (newVal, oldVal) {
if (newVal) {
this.isOff = newVal.state === 'off';
this.isPlaying = newVal.state === 'playing';
@ -253,9 +253,11 @@ Polymer({
}
}
this.async(function () {
this.fire('iron-resize');
}.bind(this), 500);
if (oldVal) {
this.async(function () {
this.fire('iron-resize');
}.bind(this), 500);
}
},
computeClassNames: function (stateObj) {