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

This commit is contained in:
azivner 2017-08-21 22:04:08 -04:00
parent 1aeb0eec59
commit aec8083d0c
2 changed files with 12 additions and 3 deletions

View file

@ -12,7 +12,7 @@
</div> </div>
<div id="content" style="margin-left: auto; margin-right: auto; width: 1100px"> <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> <button type="button" class="btn" onclick="createNewTopLevelNote()">Create new note</button>
<div id="tree" style="overflow: scroll; height: 100%;"> <div id="tree" style="overflow: scroll; height: 100%;">
@ -20,13 +20,13 @@
</div> </div>
<div style="width: 750px; float: left; margin-left: 30px;"> <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"> <form action="logout" method="POST">
<input type="submit" class="btn btn-sm" value="Logout"> <input type="submit" class="btn btn-sm" value="Logout">
</form> </form>
</div> </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;"> <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> <button class="btn btn-sm" onclick="encryptNote();">Encrypt</button>

View file

@ -5,3 +5,12 @@ $(function() {
}); });
$(window).resize(); $(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');
});