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

Commit

Permalink
improve rendering under polyfill.
Browse files Browse the repository at this point in the history
  • Loading branch information
sorvell committed Apr 15, 2014
1 parent cc79110 commit 2899f31
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
12 changes: 9 additions & 3 deletions core-overlay.html
Expand Up @@ -211,9 +211,7 @@
'resizeHandler');
if (this.opened) {
// TODO(sorvell): force SD Polyfill to render
if (window.ShadowDOMPolyfill) {
this.target.offsetHeight;
}
forcePolyfillRender(this.target);
if (!this._shouldPosition) {
this.target.style.position = 'static';
var computed = getComputedStyle(this.target);
Expand All @@ -235,6 +233,8 @@
renderOpened: function() {
var t = this.getTransition();
if (t) {
// TODO(sorvell): force SD Polyfill to render
forcePolyfillRender(this.target);
t.go(this.target, {opened: this.opened});
} else {
this.target.style.display = this.targetStyle.display;
Expand Down Expand Up @@ -408,6 +408,12 @@
},
});

function forcePolyfillRender(target) {
if (window.ShadowDOMPolyfill) {
target.offsetHeight;
}
}

// TODO(sorvell): This should be an element with private state so it can
// be independent of overlay.
// track overlays for z-index and focus managemant
Expand Down
3 changes: 0 additions & 3 deletions demo.html
Expand Up @@ -25,11 +25,8 @@
}

#confirmation {
left: 50%;
text-align: center;
width: 150px;
margin-left: -75px;
transition: all .3s ease-in-out;
}
</style>
</head>
Expand Down

0 comments on commit 2899f31

Please sign in to comment.