Sfoglia il codice sorgente

Strikethrough task text when completed

Adel Qalieh 12 anni fa
parent
commit
ad2ad32634
3 ha cambiato i file con 9 aggiunte e 1 eliminazioni
  1. 1 0
      astroid-web.coffee
  2. 4 0
      client/index.html
  3. 4 1
      style.css

+ 1 - 0
astroid-web.coffee

@@ -8,6 +8,7 @@ if Meteor.isClient
 
   Template.todos.events
     'click a.completeBox': (e) ->
+      e.preventDefault()
       now = new Date()
       Tasks.update this._id,
         $set:

+ 4 - 0
client/index.html

@@ -323,7 +323,11 @@
 {{#each tasks}}
   <div class="taskListItem">
     <a href="#" class="completeBox"></a>
+    {{#if completed}}
+    <div class="taskRowTop text-line">{{body}}</div>
+    {{else}}
     <div class="taskRowTop">{{body}}</div>
+    {{/if}}
     <small class="taskRowBottom">
       <span class="dueDate text-danger">{{formatDate dateDue}}</span> | <span class="taskItemList">{{list}}</span>
     </small>

+ 4 - 1
style.css

@@ -67,6 +67,9 @@ body {
 	padding-left: 45px;
 	cursor: pointer;
 }
+.text-line {
+  text-decoration: line-through;
+}
 .taskRowBottom {
 	padding: 1px 0 1px 45px;
 }
@@ -102,4 +105,4 @@ body {
 		text-align: center;
 		margin-top: 5px;
 	}
-}
+}