mirror of
https://github.com/sparksuite/simplemde-markdown-editor.git
synced 2024-06-29 02:40:16 +02:00
Mobile: Should prevent scroll behind fullscreen
This commit is contained in:
parent
e9d4205731
commit
35afb015a3
|
@ -94,6 +94,9 @@ function getState(cm, pos) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Saved overflow setting
|
||||||
|
var saved_overflow = "";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Toggle full screen of the editor.
|
* Toggle full screen of the editor.
|
||||||
*/
|
*/
|
||||||
|
@ -103,6 +106,15 @@ function toggleFullScreen(editor) {
|
||||||
cm.setOption("fullScreen", !cm.getOption("fullScreen"));
|
cm.setOption("fullScreen", !cm.getOption("fullScreen"));
|
||||||
|
|
||||||
|
|
||||||
|
// Prevent scrolling on body during fullscreen active
|
||||||
|
if (cm.getOption("fullScreen")) {
|
||||||
|
saved_overflow = document.body.style.overflow;
|
||||||
|
document.body.style.overflow = "hidden";
|
||||||
|
} else {
|
||||||
|
document.body.style.overflow = saved_overflow;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Update toolbar class
|
// Update toolbar class
|
||||||
var wrap = cm.getWrapperElement();
|
var wrap = cm.getWrapperElement();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue