Skip to content

Build your personal knowledge base with Trilium Notes

ctrl-alt-h now toggles visibility of everything except the main content (probably controversially also title)

azivneraec8083d0c17
diff --git a/src/templates/app.html b/src/templates/app.html
index 46d026f193..f871dae36e 100644
--- a/src/templates/app.html
+++ b/src/templates/app.html
@@ -12,7 +12,7 @@
</div>
<div id="content" style="margin-left: auto; margin-right: auto; width: 1100px">
- <div style="width: 300px; height: 100%; float: left;">
+ <div class="hide-toggle" style="width: 300px; height: 100%; float: left;">
<button type="button" class="btn" onclick="createNewTopLevelNote()">Create new note</button>
<div id="tree" style="overflow: scroll; height: 100%;">
@@ -20,13 +20,13 @@
</div>
<div style="width: 750px; float: left; margin-left: 30px;">
- <div style="float: right;">
+ <div style="float: right;" class="hide-toggle">
<form action="logout" method="POST">
<input type="submit" class="btn btn-sm" value="Logout">
</form>
</div>
- <div style="float: left; margin: 0 5px 5px 5px;">
+ <div style="float: left; margin: 0 5px 5px 5px;" class="hide-toggle">
<input type="text" autocomplete="off" value="Welcome to Notecase web app!" id="noteTitle" style="font-size: x-large; border: 0; width: 600px;">
<button class="btn btn-sm" onclick="encryptNote();">Encrypt</button>
diff --git a/static/js/init.js b/static/js/init.js
index 03abb1c715..c1ec81af58 100644
--- a/static/js/init.js
+++ b/static/js/init.js
@@ -4,4 +4,13 @@ $(function() {
$('div.note-editable').height($(window).height() - $('div.note-editable').offset().top);
});
$(window).resize();
+});
+
+jQuery.hotkeys.options.filterInputAcceptingElements = true;
+jQuery.hotkeys.options.filterContentEditable = true;
+
+$(document).bind('keypress', 'alt+ctrl+h', function() {
+ const toggle = $(".hide-toggle");
+
+ toggle.css('visibility', toggle.css('visibility') === 'hidden' ? 'visible' : 'hidden');
});
\ No newline at end of file