Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
contacts-v2: use auto centering in polymer-overlay
Browse files Browse the repository at this point in the history
  • Loading branch information
Yvonne Yip committed Oct 17, 2013
1 parent c1d7ed3 commit 6d2db09
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions shiny/Contacts-v2/components/contacts-create-item.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@
left: 10px;
box-shadow: 5px 5px 5px rgba(50, 50, 50, 0.6);
}
#typeOverlay:not(.measured) {
visibility: hidden !important;
}
#typeOverlay input {
margin-left: 0px;
height: auto;
Expand Down Expand Up @@ -81,6 +78,9 @@
error: false,
icon: 'plus',
selectedType: -1,
enteredDocument: function() {
this.$.typeOverlay.style.width = (window.innerWidth - 20) + 'px';
},
focusAction: function() {
this.active = true;
},
Expand All @@ -104,21 +104,13 @@
},
overlayAction: function() {
this.$.typeOverlay.toggle();
if (this.$.typeOverlay.active && !this.$.typeOverlay.classList.contains('measured')) {
this.async(this.measureOverlay);
}
},
overlaySelectAction: function(e, detail, sender) {
this.activeIcon = detail.item.icon;
this.$.typeOverlay.toggle();
},
focus: function() {
this.$.input.focus();
},
measureOverlay: function() {
this.$.typeOverlay.style.width = (window.innerWidth - 20) + 'px';
this.$.typeOverlay.style.top = ((window.innerHeight - this.$.typeOverlay.getBoundingClientRect().height) / 2) + 'px';
this.$.typeOverlay.classList.add('measured');
}
});
</script>
Expand Down

0 comments on commit 6d2db09

Please sign in to comment.