mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-18 07:57:38 -07:00
25 lines
510 B
JavaScript
25 lines
510 B
JavaScript
const riot = require('riot');
|
|
|
|
module.exports = me => {
|
|
if (me) {
|
|
require('./scripts/stream')(me);
|
|
}
|
|
|
|
require('./scripts/ui');
|
|
|
|
riot.mixin('open-post-form', {
|
|
openPostForm: opts => {
|
|
const app = document.getElementById('app');
|
|
app.style.display = 'none';
|
|
|
|
function recover() {
|
|
app.style.display = 'block';
|
|
}
|
|
|
|
const form = riot.mount(document.body.appendChild(document.createElement('mk-post-form')), opts)[0];
|
|
form
|
|
.on('cancel', recover)
|
|
.on('post', recover);
|
|
}
|
|
});
|
|
};
|