mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
fix prompt mutability (autocomplete on answer input field)
This commit is contained in:
parent
49bca04ebb
commit
8e16cc2326
@ -1,6 +1,9 @@
|
||||
const $dialog = $("#prompt-dialog");
|
||||
const $question = $("#prompt-dialog-question");
|
||||
const $answer = $("#prompt-dialog-answer");
|
||||
const $dialogBody = $dialog.find(".modal-body");
|
||||
|
||||
let $question;
|
||||
let $answer;
|
||||
|
||||
const $form = $("#prompt-dialog-form");
|
||||
|
||||
let resolve;
|
||||
@ -11,8 +14,21 @@ function ask({ message, defaultValue, shown }) {
|
||||
|
||||
shownCb = shown;
|
||||
|
||||
$question.text(message);
|
||||
$answer.val(defaultValue || "");
|
||||
$question = $("<label>")
|
||||
.prop("for", "prompt-dialog-answer")
|
||||
.text(message);
|
||||
|
||||
$answer = $("<input>")
|
||||
.prop("type", "text")
|
||||
.prop("id", "prompt-dialog-answer")
|
||||
.addClass("form-control")
|
||||
.val(defaultValue || "");
|
||||
|
||||
$dialogBody.empty().append(
|
||||
$("<div>")
|
||||
.addClass("form-group")
|
||||
.append($question)
|
||||
.append($answer));
|
||||
|
||||
$dialog.modal();
|
||||
|
||||
|
@ -10,10 +10,6 @@
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="form-group">
|
||||
<label for="prompt-dialog-answer" id="prompt-dialog-question"></label>
|
||||
<input type="text" class="form-control" id="prompt-dialog-answer" placeholder="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn btn-primary btn-sm" id="prompt-dialog-ok-button">OK <kbd>enter</kbd></button>
|
||||
|
Loading…
x
Reference in New Issue
Block a user