document.body.appendChild(this.createTask(timestamp, description)).focus();
},
- moveCursor: function (offset: number) {
+ moveCursor: function (offset: number): boolean {
var active = document.activeElement;
if (offset === 1 && active) {
active = active.nextElementSibling;
if (offset === -1 && active) {
active = active.previousElementSibling;
}
- if (active && active instanceof HTMLElement) active.focus();
+ if (active && active instanceof HTMLElement) {
+ active.focus();
+ return true;
+ }
+ return false;
},
};
},
};
+const BrowserUI = {
+ addTask: function (form: any) {
+ if (form.taskName.value) {
+ UI.addTask(form.taskName.value);
+ form.taskName.value = "";
+ }
+ return false;
+ },
+};
+
function focusTaskNameInput(event: any) {
document.getElementById("taskName")!.focus();
event.preventDefault();
}
}
-function browserCreateTask(form: any) {
- if (form.taskName.value) {
- UI.addTask(form.taskName.value);
- }
- form.taskName.value = "";
- return false;
-}
-
function browserInit() {
document.body.addEventListener("keydown", handleKey, { capture: false });
Log.replay();