1
0
mirror of https://github.com/fazo96/markcloud.git synced 2025-01-10 11:04:21 +01:00
markcloud/client/client.coffee
2014-10-04 08:56:18 +02:00

21 lines
457 B
CoffeeScript

docs = new Meteor.Collection 'docs'
Router.configure
layoutTemplate: 'layout'
Router.map ->
@route 'home', path: '/'
@route 'doc',
path: '/d/:_id'
layoutTemplate: 'docLayout'
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