less hacky way to implement distraction free mode which also fixes scrollbar

This commit is contained in:
zadam
2019-04-28 21:24:13 +02:00
parent 7880cf62fe
commit 3035a948b9
3 changed files with 11 additions and 20 deletions

View File

@@ -85,12 +85,7 @@ function registerEntrypoints() {
utils.bindShortcut('alt+m', e => {
$(".hide-toggle").toggle();
const $container = $("#container");
// when hiding switch display to block, otherwise grid still tries to display columns which shows
// left empty column
$container.css("display", $container.css("display") === "grid" ? "block" : "grid");
$container.toggleClass("distraction-free-mode");
$("#container").toggleClass("distraction-free-mode");
});
// hide (toggle) everything except for the note content for distraction free writing