mirror of
https://github.com/kadisonm/obsidian-homework-plugin.git
synced 2026-07-22 08:40:33 +00:00
Fix creating empty subjects and tasks
This commit is contained in:
parent
8e81c67746
commit
94d39ff879
3 changed files with 18 additions and 4 deletions
|
|
@ -296,7 +296,7 @@ export default class HomeworkModal extends Modal {
|
|||
const cancelButton = this.createIconButton(subjectPrompt, undefined, "x", {message: "Cancel", position: "bottom"});
|
||||
|
||||
inputText.addEventListener('keyup', (event) => {
|
||||
if (inputText.value.length > 0) {
|
||||
if (inputText.value.trim().length > 0) {
|
||||
saveButton.removeClass("homework-manager-hidden");
|
||||
} else {
|
||||
saveButton.addClass("homework-manager-hidden");
|
||||
|
|
@ -311,7 +311,7 @@ export default class HomeworkModal extends Modal {
|
|||
return new Promise<string | undefined>((resolve) => {
|
||||
inputText.addEventListener('keyup', (event) => {
|
||||
if (event.key === 'Enter') {
|
||||
if (inputText.value.length > 0) {
|
||||
if (inputText.value.trim().length > 0) {
|
||||
hideDiv();
|
||||
resolve(inputText.value.trim());
|
||||
}
|
||||
|
|
@ -321,7 +321,7 @@ export default class HomeworkModal extends Modal {
|
|||
saveButton.addEventListener("click", () => {
|
||||
hideDiv();
|
||||
|
||||
if (inputText.value.length > 0) {
|
||||
if (inputText.value.trim().length > 0) {
|
||||
resolve(inputText.value.trim());
|
||||
}
|
||||
|
||||
|
|
@ -361,7 +361,7 @@ export default class HomeworkModal extends Modal {
|
|||
const cancelButton = this.createIconButton(top, undefined, "x", {message: "Cancel", position: "bottom"});
|
||||
|
||||
inputText.addEventListener('keyup', (event) => {
|
||||
if (inputText.value.length > 0) {
|
||||
if (inputText.value.trim().length > 0) {
|
||||
saveButton.removeClass("homework-manager-hidden");
|
||||
} else {
|
||||
saveButton.addClass("homework-manager-hidden");
|
||||
|
|
|
|||
|
|
@ -118,6 +118,10 @@
|
|||
align-items: center;
|
||||
margin-top: 30px;
|
||||
gap: 10px;
|
||||
|
||||
input {
|
||||
width: 50%;
|
||||
}
|
||||
}
|
||||
|
||||
#task-prompt {
|
||||
|
|
@ -128,6 +132,10 @@
|
|||
align-items: center;
|
||||
gap: 10px;
|
||||
margin-bottom: 10px;
|
||||
|
||||
input {
|
||||
width: 50%;
|
||||
}
|
||||
}
|
||||
|
||||
#bottom {
|
||||
|
|
|
|||
|
|
@ -93,6 +93,9 @@
|
|||
margin-top: 30px;
|
||||
gap: 10px;
|
||||
}
|
||||
.homework-manager #subject-prompt input {
|
||||
width: 50%;
|
||||
}
|
||||
.homework-manager #task-prompt {
|
||||
margin-top: 15px;
|
||||
}
|
||||
|
|
@ -102,6 +105,9 @@
|
|||
gap: 10px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.homework-manager #task-prompt #top input {
|
||||
width: 50%;
|
||||
}
|
||||
.homework-manager #task-prompt #bottom {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
|
|
|||
Loading…
Reference in a new issue