From c83302bb80d2b1cab884526b5296d8e10ae3c03f Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 18 Feb 2017 17:39:15 +0900 Subject: [PATCH] :v: --- src/web/app/desktop/mixins.ls | 2 +- src/web/app/desktop/scripts/open-window.js | 8 ++++++++ src/web/app/desktop/scripts/open-window.ls | 8 -------- 3 files changed, 9 insertions(+), 9 deletions(-) create mode 100644 src/web/app/desktop/scripts/open-window.js delete mode 100644 src/web/app/desktop/scripts/open-window.ls diff --git a/src/web/app/desktop/mixins.ls b/src/web/app/desktop/mixins.ls index 900d7ee193..cb3c93a3df 100644 --- a/src/web/app/desktop/mixins.ls +++ b/src/web/app/desktop/mixins.ls @@ -6,7 +6,7 @@ module.exports = (me) ~> require './scripts/user-preview' - require './scripts/open-window.ls' + require './scripts/open-window' riot.mixin \notify do notify: require './scripts/notify.ls' diff --git a/src/web/app/desktop/scripts/open-window.js b/src/web/app/desktop/scripts/open-window.js new file mode 100644 index 0000000000..3f7cc424e0 --- /dev/null +++ b/src/web/app/desktop/scripts/open-window.js @@ -0,0 +1,8 @@ +const riot = require('riot'); + +riot.mixin('open-window', { + openWindow: (name, opts) => { + const window = document.body.appendChild(document.createElement(name)); + return riot.mount(window, opts)[0]; + } +}); diff --git a/src/web/app/desktop/scripts/open-window.ls b/src/web/app/desktop/scripts/open-window.ls deleted file mode 100644 index 4388272ecf..0000000000 --- a/src/web/app/desktop/scripts/open-window.ls +++ /dev/null @@ -1,8 +0,0 @@ -riot = require \riot - -function open(name, opts) - window = document.body.append-child document.create-element name - riot.mount window, opts - -riot.mixin \open-window do - open-window: open