1
0
mirror of https://github.com/MisskeyIO/misskey synced 2024-12-18 00:29:00 +09:00
MisskeyIO/src/web/app/mobile/mixins.js

24 lines
511 B
JavaScript
Raw Normal View History

2017-02-18 08:37:30 +09:00
const riot = require('riot');
module.exports = me => {
if (me) {
2017-02-18 13:23:23 +09:00
require('./scripts/stream')(me);
2017-02-18 08:37:30 +09:00
}
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);
}
});
};