js: Use an IIFE.
This commit is contained in:
parent
7a67af24f0
commit
3f21ac6b6a
@ -16,7 +16,7 @@ rules:
|
|||||||
no-throw-literal: 2
|
no-throw-literal: 2
|
||||||
no-void: 2
|
no-void: 2
|
||||||
radix: 2
|
radix: 2
|
||||||
wrap-iife: 2
|
wrap-iife: [2, "inside"]
|
||||||
brace-style: [2, "1tbs", {"allowSingleLine": true}]
|
brace-style: [2, "1tbs", {"allowSingleLine": true}]
|
||||||
comma-style: [2, "last"]
|
comma-style: [2, "last"]
|
||||||
consistent-this: [2, "self"]
|
consistent-this: [2, "self"]
|
||||||
|
@ -81,7 +81,7 @@ function isElementInViewport(node) {
|
|||||||
return boundingRect.top >= -20;
|
return boundingRect.top >= -20;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
(function() {
|
||||||
var walker = document.createTreeWalker(document.body, 4, null);
|
var walker = document.createTreeWalker(document.body, 4, null);
|
||||||
var node;
|
var node;
|
||||||
var textNodes = [];
|
var textNodes = [];
|
||||||
@ -105,3 +105,4 @@ if (el !== undefined) {
|
|||||||
sel.removeAllRanges();
|
sel.removeAllRanges();
|
||||||
sel.addRange(range);
|
sel.addRange(range);
|
||||||
}
|
}
|
||||||
|
})();
|
||||||
|
Loading…
Reference in New Issue
Block a user