added relation name autocomplete to relation map connection creation

This commit is contained in:
azivner
2018-11-13 10:42:55 +01:00
parent 8dc32e581e
commit 144e814b02
4 changed files with 28 additions and 8 deletions

View File

@@ -4,19 +4,28 @@ const $answer = $("#prompt-dialog-answer");
const $form = $("#prompt-dialog-form");
let resolve;
let shownCb;
function ask(message, defaultValue = '') {
function ask({ message, defaultValue, shown }) {
glob.activeDialog = $dialog;
shownCb = shown;
$question.text(message);
$answer.val(defaultValue);
$answer.val(defaultValue || "");
$dialog.modal();
return new Promise((res, rej) => { resolve = res; });
}
$dialog.on('shown.bs.modal', () => $answer.focus().select());
$dialog.on('shown.bs.modal', () => {
if (shownCb) {
shownCb({ $dialog, $question, $answer, $form });
}
$answer.focus().select();
});
$dialog.on("hidden.bs.modal", () => {
if (resolve) {