notes: clean up note visibility toggling.

This commit is contained in:
evazion
2020-03-26 00:09:31 -05:00
parent 1af6850c7c
commit 269c20d6ee
2 changed files with 6 additions and 9 deletions

View File

@@ -423,14 +423,7 @@ let Note = {
}, },
toggle_all: function() { toggle_all: function() {
var $note_container = $(".note-container"); $(".note-container").toggleClass("hide-notes");
var is_hidden = ($note_container.css('visibility') === 'hidden');
if (is_hidden) {
$note_container.css('visibility', 'visible');
} else {
$note_container.css('visibility', 'hidden');
}
} }
}, },
@@ -850,7 +843,7 @@ let Note = {
Note.create(x, y, w, h); Note.create(x, y, w, h);
} }
$(".note-container").css('visibility', 'visible'); $(".note-container").removeClass("hide-notes");
e.stopPropagation(); e.stopPropagation();
e.preventDefault(); e.preventDefault();
}, },

View File

@@ -2,6 +2,10 @@
display: inline-block; display: inline-block;
position: relative; position: relative;
&.hide-notes .note-box {
visibility: hidden;
}
div.note-body { div.note-body {
position: absolute; position: absolute;
border: var(--note-body-border); border: var(--note-body-border);