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 """ """ 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) { cardTapped: function(ev) {
ev.stopPropagation(); ev.stopPropagation();
this.debounce('show-more-info-dialog', function() { this.async(moreInfoActions.selectEntity.bind(
moreInfoActions.selectEntity(this.stateObj.entityId); this, this.stateObj.entityId), 100);
}.bind(this), 100);
}, },
}); });
})(); })();

View File

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

View File

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

View File

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

View File

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

View File

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