mirror of
https://github.com/zadam/trilium.git
synced 2025-11-17 02:30:42 +01:00
converted confirm dialog to new pattern
This commit is contained in:
@@ -6,6 +6,7 @@ import froca from "../../services/froca.js";
|
||||
import appContext from "../../services/app_context.js";
|
||||
import hoistedNoteService from "../../services/hoisted_note.js";
|
||||
import BasicWidget from "../basic_widget.js";
|
||||
import dialogService from "../dialog.js";
|
||||
|
||||
const TPL = `
|
||||
<div class="recent-changes-dialog modal fade mx-auto" tabindex="-1" role="dialog">
|
||||
@@ -71,13 +72,12 @@ export default class RecentChangesDialog extends BasicWidget {
|
||||
const $undeleteLink = $(`<a href="javascript:">`)
|
||||
.text("undelete")
|
||||
.on('click', async () => {
|
||||
const confirmDialog = await import('../../dialogs/confirm.js');
|
||||
const text = 'Do you want to undelete this note and its sub-notes?';
|
||||
|
||||
if (await confirmDialog.confirm(text)) {
|
||||
if (await dialogService.confirm(text)) {
|
||||
await server.put(`notes/${change.noteId}/undelete`);
|
||||
|
||||
$dialog.modal('hide');
|
||||
this.$widget.modal('hide');
|
||||
|
||||
await froca.reloadNotes([change.noteId]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user