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 """ """ 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.setEventType(eventType);
this.setEventData(eventData); this.setEventData(eventData);
this.job('showDialogAfterRender', function() {
this.$.dialog.toggle(); this.$.dialog.toggle();
}.bind(this));
}, },
setEventType: function(eventType) { setEventType: function(eventType) {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -8,6 +8,14 @@
font-family: RobotoDraft, 'Helvetica Neue', Helvetica, Arial; font-family: RobotoDraft, 'Helvetica Neue', Helvetica, Arial;
min-width: 350px; 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 { :host .sidebar {