mirror of
https://github.com/fazo96/homework.git
synced 2025-01-10 12:14:22 +01:00
fixed long descs
This commit is contained in:
parent
1f957770f7
commit
9d94fa0532
16
app.coffee
16
app.coffee
@ -29,6 +29,8 @@ if Meteor.isClient
|
|||||||
Template.userInfo.in = -> Meteor.user().emails[0].address
|
Template.userInfo.in = -> Meteor.user().emails[0].address
|
||||||
|
|
||||||
# Notes template
|
# Notes template
|
||||||
|
Template.notes.truncateNoteDesc = (s) ->
|
||||||
|
if s.length > 52 then s.slice(0,48)+"..." else s
|
||||||
Template.notes.notes = ->
|
Template.notes.notes = ->
|
||||||
d = notes.find().fetch();
|
d = notes.find().fetch();
|
||||||
#d.splice d.indexOf(Session.get('note')), 1 ; d
|
#d.splice d.indexOf(Session.get('note')), 1 ; d
|
||||||
@ -39,13 +41,17 @@ if Meteor.isClient
|
|||||||
|
|
||||||
# Note Editor
|
# Note Editor
|
||||||
Template.editor.note = -> Session.get 'note'
|
Template.editor.note = -> Session.get 'note'
|
||||||
|
saveCurrentNote = (t,e) ->
|
||||||
|
if e and e.keyCode isnt 13 then return;
|
||||||
|
notes.update Session.get('note')._id,
|
||||||
|
$set:
|
||||||
|
title: t.find('.title').value
|
||||||
|
content: t.find('.area').value
|
||||||
Template.editor.events
|
Template.editor.events
|
||||||
'click .close-editor': -> Session.set 'note', undefined
|
'click .close-editor': -> Session.set 'note', undefined
|
||||||
'click .save-editor': (e,t) ->
|
'click .save-editor': (e,t) -> saveCurrentNote t
|
||||||
notes.update Session.get('note')._id,
|
#'keypress .edit-note': (e,t) -> saveCurrentNote t, e # Doesnt work??
|
||||||
$set:
|
'keypress .title': (e,t) -> saveCurrentNote t, e
|
||||||
title: t.find('.title').value
|
|
||||||
content: t.find('.area').value
|
|
||||||
|
|
||||||
# Notifications
|
# Notifications
|
||||||
alerts = []
|
alerts = []
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
{{#each notes}}
|
{{#each notes}}
|
||||||
<li class="note list-group-item">
|
<li class="note list-group-item">
|
||||||
<button type="button" class="edit-note close"><i class="fa fa-pencil-square-o"></i></button>
|
<button type="button" class="edit-note close"><i class="fa fa-pencil-square-o"></i></button>
|
||||||
<b>{{title}}</b> <span class="subtitle">{{content}}</span>
|
<b>{{title}}</b> <span class="subtitle">{{truncateNoteDesc content}}</span>
|
||||||
<button type="button" class="close-note close">×</button>
|
<button type="button" class="close-note close">×</button>
|
||||||
</li>
|
</li>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
|
Loading…
Reference in New Issue
Block a user