1. Benoît Allard
  2. msgboard-meteor

Commits

Benoit Allard  committed cc55e4d

Get the buttons right during editing of message

  • Participants
  • Parent commits 6179097
  • Branches default

Comments (0)

Files changed (2)

File msgboard.coffee

View file
  • Ignore whitespace
 
       edit.toggle('slow')
       text.toggle('slow')
+      $('.edittoggle', msg).toggle()
     "click #save": ->
       console.log "save"
       edit = $('#edit'+this._id+' #content')
       Messages.update({_id: this._id},{$set: {content: edit.val(), last_modified_on: Date.now()}})
       edit.toggle('slow')
       text.toggle('slow')
+      $('.edittoggle', msg).toggle()
 
   Meteor.startup ->
     # send keepalives so the server can tell when we go away.

File msgboard.html

View file
  • Ignore whitespace
   <section class="message{{#if archived}} archived{{/if}}" id="{{_id}}">
     <p class=info>Posted&nbsp;
     {{#if printauthor}}by {{ user }} {{/if}}
+    {{#if edited }}
+      <span title="last modified&nbsp;{{ ago last_modified_on }}">
+    {{/if}}
     {{ ago created_on }}
-    {{#if edited }}
-      <span title="last modified&nbsp;{{ ago last_modified_on }}">*</span>
+    {{#if edited}}
+      *</span>
     {{/if}}
     </p>
     <div id="content"><span id="text">{{ content }}</span></div>
         </li>
       {{else}}
         <li>
-	  <a id="edit" href="javascript:void(0)">Edit</a>
+	  <a id="edit" class="edittoggle" href="javascript:void(0)">Edit</a>
 	</li>
         <li>
-	  <a id="archive" href="javascript:void(0)">Archive</a>
+	  <a id="archive" class="edittoggle" href="javascript:void(0)">Archive</a>
 	</li>
       {{/if}}
         <li>
-	  <a id="save" href="javascript:void(0)">Save</a>
+	  <a id="save" class="edittoggle" href="javascript:void(0)" style="display:none">Save</a>
 	</li>
     </ul></nav>
     {{/if}}