2017-02-17 17:37:30 -06:00
|
|
|
const riot = require('riot');
|
|
|
|
|
|
|
|
module.exports = me => {
|
|
|
|
if (me) {
|
2017-02-17 22:23:23 -06:00
|
|
|
require('./scripts/stream')(me);
|
2017-02-17 17:37:30 -06:00
|
|
|
}
|
|
|
|
|
2017-02-17 22:24:39 -06:00
|
|
|
require('./scripts/ui');
|
2017-02-17 17:37:30 -06:00
|
|
|
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
};
|