1
0
mirror of https://github.com/fazo96/markcloud.git synced 2025-01-26 13:34:19 +01:00
markcloud/client/client.coffee

21 lines
457 B
CoffeeScript
Raw Normal View History

2014-10-04 08:48:44 +02:00
docs = new Meteor.Collection 'docs'
Router.configure
layoutTemplate: 'layout'
Router.map ->
@route 'home', path: '/'
@route 'doc',
path: '/d/:_id'
2014-10-04 08:56:18 +02:00
layoutTemplate: 'docLayout'
2014-10-04 08:48:44 +02:00
waitOn: -> @docHandle = Meteor.subscribe 'doc', @params._id
data: -> docs.findOne @params._id
@route 'new'
Template.new.events
'click #new-btn': (e,t) ->
id = docs.insert
text: t.find('#editor').value
if id?
Router.go 'doc', _id: id