#129, added input icon to trigger recent notes for easy discovery and mouse control

This commit is contained in:
azivner
2018-07-27 09:22:25 +02:00
parent e4f459fa2b
commit 4d6eda8fe6
5 changed files with 34 additions and 9 deletions

View File

@@ -15,6 +15,7 @@ const $prefixFormGroup = $("#add-link-prefix-form-group");
const $linkTypeDiv = $("#add-link-type-div");
const $linkTypes = $("input[name='add-link-type']");
const $linkTypeHtml = $linkTypes.filter('input[value="html"]');
const $showRecentNotesButton = $("#add-link-show-recent-notes");
function setLinkType(linkType) {
$linkTypes.each(function () {
@@ -74,6 +75,10 @@ async function showDialog() {
},
minLength: 0,
change: async (event, ui) => {
if (!ui.item) {
return;
}
const notePath = linkService.getNodePathFromLabel(ui.item.value);
if (!notePath) {
@@ -103,7 +108,7 @@ async function showDialog() {
}
});
$autoComplete.autocomplete("search", "");
showRecentNotes();
}
$form.submit(() => {
@@ -167,8 +172,14 @@ function linkTypeChanged() {
$linkTypeDiv.toggle(!hasSelection());
}
function showRecentNotes() {
$autoComplete.autocomplete("search", "");
}
$linkTypes.change(linkTypeChanged);
$showRecentNotesButton.click(showRecentNotes);
export default {
showDialog
};