]> git.scottworley.com Git - vopamoi/blobdiff - vopamoi.ts
Sort log apply actions
[vopamoi] / vopamoi.ts
index a76db5b982b99a1c3ccfd38f82fcd3815b845efa..6cee2a175c0f51748f5940f31bfd66fec660a11e 100644 (file)
@@ -33,7 +33,7 @@ const Model = {
   addTask: function (timestamp: string, description: string): Element {
     const task = document.createElement("div");
     task.appendChild(document.createTextNode(description));
-    task.setAttribute("class", "task");
+    task.classList.add("task");
     task.setAttribute("tabindex", "0");
     task.setAttribute("data-created", timestamp);
     task.setAttribute("data-state", "todo");
@@ -115,14 +115,14 @@ function Log(prefix: string = "vp-") {
         const [createTimestamp, description] = splitN(data, " ", 1);
         return Model.edit(createTimestamp, description);
       }
-      if (command == "State") {
-        const [createTimestamp, state] = splitN(data, " ", 1);
-        return Model.setState(timestamp, createTimestamp, state);
-      }
       if (command == "Priority") {
         const [createTimestamp, newPriority] = splitN(data, " ", 1);
         return Model.setPriority(createTimestamp, parseFloat(newPriority));
       }
+      if (command == "State") {
+        const [createTimestamp, state] = splitN(data, " ", 1);
+        return Model.setState(timestamp, createTimestamp, state);
+      }
     },
 
     record: function (entry: string) {