explicitly use 'window' when getting its properties
This commit is contained in:
parent
1af1194e9f
commit
59899b9395
10
edit.js
10
edit.js
|
@ -1113,8 +1113,8 @@ function init() {
|
|||
section[CssToProperty[i]] = [params[i]];
|
||||
}
|
||||
}
|
||||
onload = () => {
|
||||
onload = null;
|
||||
window.onload = () => {
|
||||
window.onload = null;
|
||||
addSection(null, section);
|
||||
// default to enabled
|
||||
document.getElementById("enabled").checked = true
|
||||
|
@ -1132,12 +1132,12 @@ function init() {
|
|||
}
|
||||
styleId = style.id;
|
||||
setStyleMeta(style);
|
||||
onload = () => {
|
||||
onload = null;
|
||||
window.onload = () => {
|
||||
window.onload = null;
|
||||
initWithStyle({style});
|
||||
};
|
||||
if (document.readyState != 'loading') {
|
||||
onload();
|
||||
window.onload();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -70,7 +70,7 @@ function showStyles(styles = []) {
|
|||
const sorted = styles
|
||||
.map(style => ({name: style.name.toLocaleLowerCase(), style}))
|
||||
.sort((a, b) => (a.name < b.name ? -1 : a.name == b.name ? 0 : 1));
|
||||
const shouldRenderAll = history.state && history.state.scrollY > innerHeight;
|
||||
const shouldRenderAll = (history.state || {}).scrollY > window.innerHeight;
|
||||
const renderBin = document.createDocumentFragment();
|
||||
tDocLoader.stop();
|
||||
renderStyles(0);
|
||||
|
@ -477,7 +477,7 @@ function searchStyles({immediately, container}) {
|
|||
|
||||
|
||||
function rememberScrollPosition() {
|
||||
history.replaceState({scrollY}, document.title);
|
||||
history.replaceState({scrollY: window.scrollY}, document.title);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user