Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

quick fix for refresh() when not applicable #3

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions viewport-units-buggyfill.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@
var dimensions;
var declarations;
var styleNode;
var applicable = true;

function initialize(force) {
if (!force && !/ip.+mobile.+safari/i.test(window.navigator.userAgent)) {
// this buggyfill only applies to mobile safari
applicable = false;
return;
}

Expand All @@ -47,8 +49,10 @@
}

function refresh() {
findProperties();
updateStyles();
if(applicable) {
findProperties();
updateStyles();
}
}

function findProperties() {
Expand Down Expand Up @@ -183,4 +187,4 @@
init: initialize,
refresh: refresh
};
}));
}));