escape should close the recent notes dialog

This commit is contained in:
azivner 2018-02-11 11:53:43 -05:00
parent 4b1d1aba74
commit 438f7c5b0b

View file

@ -59,9 +59,15 @@ const recentNotes = (function() {
event.preventDefault();
},
close: function (event, ui) {
if (event.keyCode === 27) { // escape closes dialog
$searchInput.autocomplete('destroy');
$dialog.dialog('close');
}
else {
// keep autocomplete open
// we're kind of abusing autocomplete to work in a way which it's not designed for
$searchInput.autocomplete("search", "")
$searchInput.autocomplete("search", "");
}
},
create: () => $searchInput.autocomplete("search", ""),
classes: {