Frontend: clean up code

This commit is contained in:
Paulus Schoutsen 2015-07-06 00:30:36 -07:00
parent 56c5d28ede
commit 4d81953562
8 changed files with 635 additions and 436 deletions

View File

@ -1,2 +1,2 @@
""" DO NOT MODIFY. Auto-generated by build_frontend script """
VERSION = "5fe3c81071fb3a771d93105eb9b911ed"
VERSION = "cae518aa6f1112fca0e0b9cf3adfea62"

File diff suppressed because one or more lines are too long

View File

@ -47,9 +47,8 @@
cardTapped: function(ev) {
ev.stopPropagation();
this.debounce('show-more-info-dialog', function() {
moreInfoActions.selectEntity(this.stateObj.entityId);
}.bind(this), 100);
this.async(moreInfoActions.selectEntity.bind(
this, this.stateObj.entityId), 100);
},
});
})();

View File

@ -118,9 +118,11 @@
this.fetchHistoryData();
window.requestAnimationFrame(function() {
// allow dialog to render content before showing it so it is
// positioned correctly.
this.async(function() {
this.dialogOpen = true;
}.bind(this));
}.bind(this), 10);
},
dialogOpenChanged: function(newVal) {

View File

@ -13,6 +13,10 @@
<dom-module id="login-form">
<style>
:host {
white-space: nowrap;
}
#passwordDecorator {
display: block;
height: 57px;
@ -128,9 +132,7 @@
isValidatingChanged: function(newVal) {
if (!newVal) {
this.debounce('focus-password', function() {
this.$.passwordInput.focus();
}.bind(this), 1);
this.async(function() { this.$.passwordInput.focus(); }.bind(this), 10);
}
},

View File

@ -89,10 +89,9 @@
isStaleChanged: function(newVal) {
if (newVal) {
// isLoading wouldn't update without debounce <_<
this.debounce('fetch-logbook-entries', function() {
logbookActions.fetchDate(this.selectedDate);
}, 0);
// isLoading wouldn't update without async <_<
this.async(
function() { logbookActions.fetchDate(this.selectedDate); }, 10);
}
},

View File

@ -73,7 +73,7 @@
this.brightnessSliderValue = newVal.attributes.brightness;
}
this.debounce('more-info-light-animation-finish', function() {
this.async(function() {
this.fire('iron-resize');
}.bind(this), 500);
},

View File

@ -127,7 +127,7 @@
},
stateObjChanged: function(newVal, oldVal) {
stateObjChanged: function(newVal) {
if (newVal) {
this.isOff = newVal.state == 'off';
this.isPlaying = newVal.state == 'playing';
@ -142,9 +142,7 @@
this.supportsTurnOff = (newVal.attributes.supported_media_commands & 256) !== 0;
}
this.debounce('more-info-volume-animation-finish', function() {
this.fire('iron-resize');
}.bind(this), 500);
this.async(function() { this.fire('iron-resize'); }.bind(this), 500);
},
computeClassNames: function(stateObj) {