}
},
+ removeTag: function (createTimestamp: string, tagName: string) {
+ const task = this.getTask(createTimestamp);
+ if (!task) return null;
+ const tag = this.hasTag(task, tagName);
+ if (!tag) return;
+ task.removeChild(tag);
+ },
+
setPriority: function (createTimestamp: string, priority: number): Element | null {
const target = this.getTask(createTimestamp);
if (!target) return null;
const [createTimestamp, tag] = splitN(data, " ", 1);
return Model.addTag(createTimestamp, tag);
}
+ if (command == "Untag") {
+ const [createTimestamp, tag] = splitN(data, " ", 1);
+ return Model.removeTag(createTimestamp, tag);
+ }
},
record: function (entry: string) {
return <Element>log.recordAndApply(`${now} Create ${description}`);
},
addTag: function (createTimestamp: string, tag: string) {
- // TODO: undo
+ undoLog.push(`Untag ${createTimestamp} ${tag}`);
return log.recordAndApply(`${clock.now()} Tag ${createTimestamp} ${tag}`);
},
edit: function (createTimestamp: string, newDescription: string, oldDescription: string) {