mirror of
https://iceshrimp.dev/crimekillz/trashposs
synced 2024-11-23 17:29:05 +01:00
✌️
This commit is contained in:
parent
3083630cf5
commit
c1fc9a7d41
23
src/web/app/mobile/mixins.js
Normal file
23
src/web/app/mobile/mixins.js
Normal 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);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
@ -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
|
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
require('./tags');
|
require('./tags');
|
||||||
const boot = require('../boot.js');
|
const boot = require('../boot.js');
|
||||||
const mixins = require('./mixins.ls');
|
const mixins = require('./mixins');
|
||||||
const route = require('./router.ls');
|
const route = require('./router.ls');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user