rollbacked: use simpler confirm instead on promise-based function
This commit is contained in:
parent
aa198d6b56
commit
da8bb40160
15
main.js
15
main.js
|
@ -426,25 +426,20 @@ function includesub()
|
||||||
if (range)
|
if (range)
|
||||||
{
|
{
|
||||||
var title = linkatpos();
|
var title = linkatpos();
|
||||||
ask("Replace [[" + title + "]] by its content?")
|
if confirm("Replace [[" + title + "]] by its content?")
|
||||||
.then( (answser) =>
|
|
||||||
{
|
{
|
||||||
if (answser != "Yes") return;
|
|
||||||
|
|
||||||
var subnote = getnote(title);
|
var subnote = getnote(title);
|
||||||
md.value =
|
md.value =
|
||||||
md.value.substring(0, range.start)
|
md.value.substring(0, range.start)
|
||||||
+ subnote.content
|
+ subnote.content
|
||||||
+ md.value.substring(range.end);
|
+ md.value.substring(range.end);
|
||||||
|
|
||||||
ask("Delete '" + title + "'?")
|
if confirm("Delete '" + title + "'?")
|
||||||
.then( (answser) =>
|
|
||||||
{
|
{
|
||||||
if (answser != "Yes") return;
|
|
||||||
deletenote(subnote);
|
deletenote(subnote);
|
||||||
})
|
datachanged();
|
||||||
.finally(datachanged);
|
}
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue