Sharkey/src/web/app/mobile/mixins.ls

20 lines
464 B
Text
Raw Normal View History

2016-12-29 00:49:51 +02:00
riot = require \riot
module.exports = (me) ~>
if me?
(require './scripts/stream.ls') me
require './scripts/ui.ls'
riot.mixin \open-post-form do
open-post-form: (opts) ->
app = document.get-element-by-id \app
app.style.display = \none
form = document.body.append-child document.create-element \mk-post-form
form = riot.mount form, opts .0
form.on \cancel recover
form.on \post recover
function recover
app.style.display = \block