mirror of
https://github.com/rifts-obsidian-laboratory/anki-integration.git
synced 2026-07-22 05:42:50 +00:00
Features - Issue #14 (Bis) - AddNoteFromCodeBlockModal.ts & AddNoteModal.ts
This commit is contained in:
parent
3ec55e6452
commit
c0cb6860e0
2 changed files with 15 additions and 0 deletions
|
|
@ -131,10 +131,16 @@ export class AddNoteFromCodeBlockModal extends Modal {
|
|||
"ankiIntegrationModal__container--flex-wrap",
|
||||
"ankiIntegrationModal__container--gap-16px"
|
||||
])
|
||||
|
||||
const tagsBodyParagraph: HTMLElement = AddParagraph(tagsBody, "No tags will be added to this note, click the \"+\" button to add a new one.");
|
||||
|
||||
/**
|
||||
* @description addTagFieldButton's onClick() event listener used to add a tag input group in tagsBody.
|
||||
*/
|
||||
addTagFieldButton.onClick(async () => {
|
||||
if (tagsBody.firstChild == tagsBodyParagraph) {
|
||||
tagsBody.removeChild(tagsBodyParagraph);
|
||||
}
|
||||
/**
|
||||
* @type {HTMLDivElement} inputGroup
|
||||
* @description A container storing the input field and the delete input field button.
|
||||
|
|
@ -273,6 +279,9 @@ export class AddNoteFromCodeBlockModal extends Modal {
|
|||
AutoAssignDeck(deckSelector, codeBlockParameters);
|
||||
AutoAssignModel(modelSelector, codeBlockParameters);
|
||||
if (codeBlockParameters["tags"] != null) {
|
||||
if (codeBlockParameters["tags"].length > 0) {
|
||||
tagsBody.removeChild(tagsBody.children[0]);
|
||||
}
|
||||
for (let i = 0; i < codeBlockParameters["tags"].length; i++) {
|
||||
AddTagInputGroup(tagsBody, codeBlockParameters["tags"][i]);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -124,10 +124,16 @@ export class AddNoteModal extends Modal {
|
|||
"ankiIntegrationModal__container--flex-wrap",
|
||||
"ankiIntegrationModal__container--gap-16px"
|
||||
])
|
||||
|
||||
const tagsBodyParagraph: HTMLElement = AddParagraph(tagsBody, "No tags will be added to this note, click the \"+\" button to add a new one.");
|
||||
|
||||
/**
|
||||
* @description addTagFieldButton's onClick() event listener used to add a tag input group in tagsBody.
|
||||
*/
|
||||
addTagFieldButton.onClick(async () => {
|
||||
if (tagsBody.firstChild == tagsBodyParagraph) {
|
||||
tagsBody.removeChild(tagsBodyParagraph);
|
||||
}
|
||||
/**
|
||||
* @type {HTMLDivElement} inputGroup
|
||||
* @description A container storing the input field and the delete input field button.
|
||||
|
|
|
|||
Loading…
Reference in a new issue