added history button

This commit is contained in:
azivner 2017-10-09 11:28:56 -04:00
parent 5b3dafd395
commit 29f50f47b8
3 changed files with 13 additions and 4 deletions

View File

@ -6,7 +6,7 @@
</head> </head>
<body> <body>
<div id="container"> <div id="container">
<div class="hide-toggle" style="grid-area: header; background-color: #f1f1f1;"> <div id="header" class="hide-toggle" style="grid-area: header; background-color: #f1f1f1;">
<div style="display: flex; align-items: center;"> <div style="display: flex; align-items: center;">
<div id="header-title"> <div id="header-title">
Trilium Trilium
@ -81,6 +81,8 @@
&nbsp; &nbsp;
<input autocomplete="off" value="" id="noteTitle" style="font-size: x-large; border: 0; flex-grow: 100;" tabindex="1"> <input autocomplete="off" value="" id="noteTitle" style="font-size: x-large; border: 0; flex-grow: 100;" tabindex="1">
<button class="btn btn-xs" onclick="showCurrentNoteHistory();">History</button>
</div> </div>
</div> </div>

View File

@ -1,5 +1,9 @@
let globalHistoryItems = null; let globalHistoryItems = null;
function showCurrentNoteHistory() {
showNoteHistoryDialog(globalCurrentNote.detail.note_id);
}
function showNoteHistoryDialog(noteId, noteHistoryId) { function showNoteHistoryDialog(noteId, noteHistoryId) {
$("#noteHistoryDialog").dialog({ $("#noteHistoryDialog").dialog({
modal: true, modal: true,
@ -37,9 +41,7 @@ function showNoteHistoryDialog(noteId, noteHistoryId) {
}); });
} }
$(document).bind('keydown', 'alt+h', function() { $(document).bind('keydown', 'alt+h', showCurrentNoteHistory);
showNoteHistoryDialog(globalCurrentNote.detail.note_id);
});
$("#noteHistoryList").on('change', () => { $("#noteHistoryList").on('change', () => {
const optVal = $("#noteHistoryList").find(":selected").val(); const optVal = $("#noteHistoryList").find(":selected").val();

View File

@ -91,3 +91,8 @@ span.fancytree-node.encrypted.fancytree-folder > span.fancytree-icon {
font-size: large; font-size: large;
font-weight: bold; font-weight: bold;
} }
#header .btn-xs {
margin-bottom: 2px;
margin-right: 8px;
}