diff --git a/src/public/app/dialogs/password_not_set.js b/src/public/app/dialogs/password_not_set.js deleted file mode 100644 index 88bcbe6d5..000000000 --- a/src/public/app/dialogs/password_not_set.js +++ /dev/null @@ -1,13 +0,0 @@ -import utils from "../services/utils.js"; -import appContext from "../services/app_context.js"; - -export function show() { - const $dialog = $("#password-not-set-dialog"); - const $openPasswordOptionsButton = $("#open-password-options-button"); - - utils.openDialog($dialog); - - $openPasswordOptionsButton.on("click", () => { - appContext.triggerCommand("showOptions", { openTab: 'password' }); - }); -} diff --git a/src/public/app/layouts/desktop_layout.js b/src/public/app/layouts/desktop_layout.js index 501443b3f..df42cc521 100644 --- a/src/public/app/layouts/desktop_layout.js +++ b/src/public/app/layouts/desktop_layout.js @@ -58,6 +58,7 @@ import RecentChangesDialog from "../widgets/dialogs/recent_changes.js"; import BackendLogDialog from "../widgets/dialogs/backend_log.js"; import BranchPrefixDialog from "../widgets/dialogs/branch_prefix.js"; import SortChildNotesDialog from "../widgets/dialogs/sort_child_notes.js"; +import PasswordNoteSetDialog from "../widgets/dialogs/password_not_set.js"; export default class DesktopLayout { constructor(customWidgets) { @@ -190,6 +191,7 @@ export default class DesktopLayout { .child(new RecentChangesDialog()) .child(new BackendLogDialog()) .child(new BranchPrefixDialog()) - .child(new SortChildNotesDialog()); + .child(new SortChildNotesDialog()) + .child(new PasswordNoteSetDialog()); } } diff --git a/src/public/app/services/protected_session.js b/src/public/app/services/protected_session.js index 8b5a33745..ee53ea451 100644 --- a/src/public/app/services/protected_session.js +++ b/src/public/app/services/protected_session.js @@ -20,7 +20,7 @@ function enterProtectedSession() { const dfd = $.Deferred(); if (!options.is("isPasswordSet")) { - import("../dialogs/password_not_set.js").then(dialog => dialog.show()); + appContext.triggerCommand("showPasswordNotSet"); return dfd; } diff --git a/src/public/app/widgets/dialogs/password_not_set.js b/src/public/app/widgets/dialogs/password_not_set.js new file mode 100644 index 000000000..e890c946c --- /dev/null +++ b/src/public/app/widgets/dialogs/password_not_set.js @@ -0,0 +1,38 @@ +import utils from "../../services/utils.js"; +import BasicWidget from "../basic_widget.js"; + +const TPL = ` +