This commit is contained in:
syuilo 2017-02-18 08:37:30 +09:00
parent bb507d0be1
commit d9e90e97f8
3 changed files with 24 additions and 20 deletions

View file

@ -0,0 +1,23 @@
const riot = require('riot');
module.exports = me => {
if (me) {
require('./scripts/stream.ls')(me);
}
require('./scripts/ui.ls');
riot.mixin('open-post-form', {
openPostForm: opts => {
const app = document.getElementById('app');
app.style.display = 'none';
const form = riot.mount(document.body.appendChild(document.createElement('mk-post-form')), opts)[0];
function recover() {
app.style.display = 'block';
}
form
.on('cancel', recover)
.on('post', recover);
}
});
};

View file

@ -1,19 +0,0 @@
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

View file

@ -4,7 +4,7 @@
require('./tags');
const boot = require('../boot.js');
const mixins = require('./mixins.ls');
const mixins = require('./mixins');
const route = require('./router.ls');
/**