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 $dialog = $("#prompt-dialog");
|
||||||
const $question = $("#prompt-dialog-question");
|
const $dialogBody = $dialog.find(".modal-body");
|
||||||
const $answer = $("#prompt-dialog-answer");
|
|
||||||
|
let $question;
|
||||||
|
let $answer;
|
||||||
|
|
||||||
const $form = $("#prompt-dialog-form");
|
const $form = $("#prompt-dialog-form");
|
||||||
|
|
||||||
let resolve;
|
let resolve;
|
||||||
@ -11,8 +14,21 @@ function ask({ message, defaultValue, shown }) {
|
|||||||
|
|
||||||
shownCb = shown;
|
shownCb = shown;
|
||||||
|
|
||||||
$question.text(message);
|
$question = $("<label>")
|
||||||
$answer.val(defaultValue || "");
|
.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();
|
$dialog.modal();
|
||||||
|
|
||||||
|
@ -10,10 +10,6 @@
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<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>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button class="btn btn-primary btn-sm" id="prompt-dialog-ok-button">OK <kbd>enter</kbd></button>
|
<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