Skip to content

Commit

Permalink
Move browser related objects from global to function level (michalsni…
Browse files Browse the repository at this point in the history
  • Loading branch information
vcfvct authored and michalsnik committed Jun 22, 2018
1 parent 4f9b53d commit 193ff45
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/js/aos.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ import elements from './helpers/elements';
let $aosElements = [];
let initialized = false;

// Detect not supported browsers (<=IE9)
// http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805
const browserNotSupported = document.all && !window.atob;

/**
* Default options
*/
Expand Down Expand Up @@ -130,6 +126,10 @@ const init = function init(settings) {
// Create initial array with elements -> to be fullfilled later with prepare()
$aosElements = elements();

// Detect not supported browsers (<=IE9)
// http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805
const browserNotSupported = document.all && !window.atob;

/**
* Don't init plugin if option `disable` is set
* or when browser is not supported
Expand Down
10 changes: 5 additions & 5 deletions src/js/libs/observer.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
const doc = window.document;
const MutationObserver =
let callback = () => {};

function ready(selector, fn) {
const doc = window.document;
const MutationObserver =
window.MutationObserver ||
window.WebKitMutationObserver ||
window.MozMutationObserver;

let callback = () => {};

function ready(selector, fn) {
const observer = new MutationObserver(check);
callback = fn;

Expand Down

0 comments on commit 193ff45

Please sign in to comment.