Better positioning of dialogs

This commit is contained in:
Paulus Schoutsen 2015-01-14 23:57:23 -08:00
parent ced3d595cc
commit c116cb095d
9 changed files with 44 additions and 27 deletions

View File

@ -1,2 +1,2 @@
""" DO NOT MODIFY. Auto-generated by build_frontend script """
VERSION = "1da0ea4a1fbd7b74cf749841b86bbb2d"
VERSION = "a82c6e4bf6b91042a6e891d46464275d"

File diff suppressed because one or more lines are too long

View File

@ -55,7 +55,9 @@ Polymer({
this.setEventType(eventType);
this.setEventData(eventData);
this.$.dialog.toggle();
this.job('showDialogAfterRender', function() {
this.$.dialog.toggle();
}.bind(this));
},
setEventType: function(eventType) {

View File

@ -13,12 +13,6 @@
layered: true,
backdrop: true,
transition: 'core-transition-bottom',
domReady: function() {
this.addEventListener('core-overlay-open-completed', function() {
this.resizeHandler();
}.bind(this));
},
});
</script>
</polymer-element>

View File

@ -29,23 +29,23 @@
Polymer({
stateObj: {},
// observe: {
// 'stateObj.attributes': 'reposition'
// },
observe: {
'stateObj.attributes': 'reposition'
},
/**
* Whenever the attributes change, the more info component can
* hide or show elements. We will reposition the dialog.
* DISABLED FOR NOW - BAD UX
*/
// reposition: function(oldVal, newVal) {
reposition: function(oldVal, newVal) {
// Only resize if already open
// if(this.$.dialog.opened) {
// this.job('resizeAfterLayoutChange', function() {
// this.$.dialog.resizeHandler();
// }.bind(this));
// }
// },
if(this.$.dialog.opened) {
this.job('resizeAfterLayoutChange', function() {
this.$.dialog.resizeHandler();
}.bind(this), 1000);
}
},
show: function(stateObj) {
this.stateObj = stateObj;

View File

@ -55,7 +55,9 @@ Polymer({
this.setService(domain, service);
this.$.inputData.value = serviceData;
// this.$.inputDataWrapper.update();
this.$.dialog.toggle();
this.job('showDialogAfterRender', function() {
this.$.dialog.toggle();
}.bind(this));
},
setService: function(domain, service) {

View File

@ -60,7 +60,9 @@ Polymer({
this.setState(state);
this.setStateData(stateData);
this.$.dialog.toggle();
this.job('showDialogAfterRender', function() {
this.$.dialog.toggle();
}.bind(this));
},
setEntityId: function(entityId) {

View File

@ -26,7 +26,7 @@
max-height: 0px;
overflow: hidden;
transition: max-height .5s ease-in;
transition: max-height .5s ease-in .3s;
}
:host-context(.has-brightness) .brightness {

View File

@ -8,6 +8,14 @@
font-family: RobotoDraft, 'Helvetica Neue', Helvetica, Arial;
min-width: 350px;
max-width: 700px;
/* First two are from core-transition-bottom */
transition:
transform 0.2s ease-in-out,
opacity 0.2s ease-in,
top .3s,
left .3s !important;
}
:host .sidebar {