mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-27 19:23:08 +02:00
✌️
This commit is contained in:
parent
7602f16727
commit
a62fe67e25
3 changed files with 17 additions and 18 deletions
|
@ -11,7 +11,7 @@ module.exports = (me) ~>
|
||||||
riot.mixin \notify do
|
riot.mixin \notify do
|
||||||
notify: require './scripts/notify'
|
notify: require './scripts/notify'
|
||||||
|
|
||||||
dialog = require './scripts/dialog.ls'
|
dialog = require './scripts/dialog'
|
||||||
|
|
||||||
riot.mixin \dialog do
|
riot.mixin \dialog do
|
||||||
dialog: dialog
|
dialog: dialog
|
||||||
|
|
16
src/web/app/desktop/scripts/dialog.js
Normal file
16
src/web/app/desktop/scripts/dialog.js
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
const riot = require('riot');
|
||||||
|
|
||||||
|
module.exports = (title, text, buttons, canThrough, onThrough) => {
|
||||||
|
const dialog = document.body.appendChild(document.createElement('mk-dialog'));
|
||||||
|
const controller = riot.observable();
|
||||||
|
riot.mount(dialog, {
|
||||||
|
controller: controller,
|
||||||
|
title: title,
|
||||||
|
text: text,
|
||||||
|
buttons: buttons,
|
||||||
|
canThrough: canThrough,
|
||||||
|
onThrough: onThrough
|
||||||
|
});
|
||||||
|
controller.trigger('open');
|
||||||
|
return controller;
|
||||||
|
};
|
|
@ -1,17 +0,0 @@
|
||||||
# Dialog
|
|
||||||
#================================
|
|
||||||
|
|
||||||
riot = require 'riot'
|
|
||||||
|
|
||||||
module.exports = (title, text, buttons, can-through, on-through) ~>
|
|
||||||
dialog = document.body.append-child document.create-element \mk-dialog
|
|
||||||
controller = riot.observable!
|
|
||||||
riot.mount dialog, do
|
|
||||||
controller: controller
|
|
||||||
title: title
|
|
||||||
text: text
|
|
||||||
buttons: buttons
|
|
||||||
can-through: can-through
|
|
||||||
on-through: on-through
|
|
||||||
controller.trigger \open
|
|
||||||
return controller
|
|
Loading…
Reference in a new issue