Skip to content

Commit

Permalink
Merge branch 'master' of github.com:marcj/css-element-queries
Browse files Browse the repository at this point in the history
  • Loading branch information
marcj committed Nov 6, 2018
2 parents f6144fb + da5f446 commit 5adf8a6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/ElementQueries.js
Original file line number Diff line number Diff line change
Expand Up @@ -409,9 +409,11 @@

document.body.addEventListener(animationStart, function (e) {
var element = e.target;
var styles = window.getComputedStyle(element, null);
var styles = element && window.getComputedStyle(element, null);
var animationName = styles && styles.getPropertyValue('animation-name');
var requiresSetup = animationName && (-1 !== animationName.indexOf('element-queries'));

if (-1 !== styles.getPropertyValue('animation-name').indexOf('element-queries')) {
if (requiresSetup) {
element.elementQueriesSensor = new ResizeSensor(element, function () {
if (element.elementQueriesSetupInformation) {
element.elementQueriesSetupInformation.call();
Expand Down

0 comments on commit 5adf8a6

Please sign in to comment.