shortcut: shift + x = toggle strikethrough and fade text
[apps/outliner/.git] / src / outline.ts
index 9a2d2c037248f541380091f3378ccefb908777b1..ea22d23b161feaf23d9c99dd9c32e7c59789d1d1 100644 (file)
@@ -21,6 +21,7 @@ export interface OutlineNode {
   created: number;
   type: 'text',
   content: string,
+  strikethrough: boolean;
 };
 
 export class Outline {
@@ -179,7 +180,8 @@ export class Outline {
       id: uuid(),
       created: Date.now(),
       type: 'text',
-      content: '---'
+      content: '---',
+      strikethrough: false
     };
 
     this.data.contentNodes[outlineNode.id] = outlineNode;
@@ -209,7 +211,8 @@ export class Outline {
       id: uuid(),
       created: Date.now(),
       type: 'text',
-      content: '---'
+      content: '---',
+      strikethrough: false
     };
 
     if(!nodeId) {
@@ -288,10 +291,13 @@ export class Outline {
       id: node.id,
       created: Date.now(),
       type: 'text',
-      content: ''
+      content: '',
+      strikethrough: false
     };
 
-    let html = `<div class="node ${collapse}" data-id="${node.id}" id="id-${node.id}">
+    const strikethrough = content.strikethrough ? 'strikethrough' : '';
+
+    let html = `<div class="node ${collapse} ${strikethrough}" data-id="${node.id}" id="id-${node.id}">
     <div class="nodeContent" data-type="${content.type}">
       ${this.renderContent(node.id)}
     </div>