MCPcopy
hub / github.com/callumalpass/tasknotes / createActionButtons

Method createActionButtons

src/modals/TaskEditModal.ts:678–714  ·  view source on GitHub ↗
(container: HTMLElement)

Source from the content-addressed store, hash-verified

676 }
677
678 protected createActionButtons(container: HTMLElement): void {
679 createTaskModalActionButtons(this.getActionButtonContext(), {
680 container,
681 leadingButtons: [
682 {
683 className: "tn-task-modal__open-note-button",
684 text: this.t("modals.task.buttons.openNote"),
685 onClick: () => {
686 void this.openTaskNote();
687 },
688 },
689 {
690 className: "mod-warning tn-task-modal__archive-button",
691 text: this.task.archived
692 ? this.t("modals.taskEdit.buttons.unarchive")
693 : this.t("modals.taskEdit.buttons.archive"),
694 onClick: () => {
695 void this.archiveTask();
696 },
697 },
698 {
699 className: "mod-warning tn-task-modal__delete-button",
700 text: this.t("contextMenus.task.delete"),
701 onClick: () => {
702 void this.deleteTask();
703 },
704 },
705 ],
706 onSave: () => this.handleSave(),
707 onSaved: () => {
708 this.forceClose();
709 },
710 onCancel: () => {
711 this.close();
712 },
713 });
714 }
715
716 protected async initializeSubtasks(): Promise<void> {
717 try {

Calls 8

openTaskNoteMethod · 0.95
archiveTaskMethod · 0.95
deleteTaskMethod · 0.95
handleSaveMethod · 0.95
forceCloseMethod · 0.95
closeMethod · 0.95
tMethod · 0.45

Tested by

no test coverage detected