mirror of
https://github.com/jsbin/jsbin.git
synced 2026-01-18 15:18:04 +00:00
Stop browser from scrolling out the app
This commit is contained in:
parent
d26e262d0f
commit
f476ef5342
@ -66,4 +66,12 @@ if (/gist\/\d+/.test(window.location.pathname) && (!sessionStorage.getItem('java
|
||||
}
|
||||
}
|
||||
|
||||
// prevent the app from accidently getting scrolled out of view
|
||||
document.body.onscroll = window.onscroll = function () {
|
||||
if (document.body.scrollTop !== 0) {
|
||||
window.scrollTo(0,0);
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
window.CodeMirror = CodeMirror; // fix to allow code mirror to break naturally
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user