summaryrefslogtreecommitdiff
path: root/src/web
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2017-02-21 09:59:53 +0900
committersyuilo <syuilotan@yahoo.co.jp>2017-02-21 09:59:53 +0900
commit7921d3508a57e5d711a5d4a99b2a9f6b395c92ff (patch)
tree9f0c78b3f0a3dc26ec99c7a3d80f9db6b2569533 /src/web
parentwip (diff)
downloadmisskey-7921d3508a57e5d711a5d4a99b2a9f6b395c92ff.tar.gz
misskey-7921d3508a57e5d711a5d4a99b2a9f6b395c92ff.tar.bz2
misskey-7921d3508a57e5d711a5d4a99b2a9f6b395c92ff.zip
wip
Diffstat (limited to 'src/web')
-rw-r--r--src/web/app/desktop/tags/input-dialog.tag28
-rw-r--r--src/web/app/mobile/tags/home.tag2
2 files changed, 19 insertions, 11 deletions
diff --git a/src/web/app/desktop/tags/input-dialog.tag b/src/web/app/desktop/tags/input-dialog.tag
index aa417f0a7e..f343c4625a 100644
--- a/src/web/app/desktop/tags/input-dialog.tag
+++ b/src/web/app/desktop/tags/input-dialog.tag
@@ -133,29 +133,35 @@
this.text.focus();
this.refs.window.on('closing', () => {
- if @done
- this.opts.on-ok @text.value
- else
- if this.opts.on-cancel?
- this.opts.on-cancel!
+ if (this.done) {
+ this.opts.onOk(this.text.value);
+ } else {
+ if (this.opts.onCancel) this.opts.onCancel();
+ }
+ });
this.refs.window.on('closed', () => {
this.unmount();
});
+ });
this.cancel = () => {
- this.done = false
+ this.done = false;
this.refs.window.close();
+ };
this.ok = () => {
- if not @allow-empty and @text.value == '' then return
- this.done = true
+ if (!this.allowEmpty && this.text.value == '') return;
+ this.done = true;
this.refs.window.close();
+ };
- this.onKeydown = (e) => {
- if e.which == 13 // Enter
+ this.onKeydown = e => {
+ if (e.which == 13) { // Enter
e.preventDefault();
e.stopPropagation();
- @ok!
+ this.ok();
+ }
+ };
</script>
</mk-input-dialog>
diff --git a/src/web/app/mobile/tags/home.tag b/src/web/app/mobile/tags/home.tag
index 0ca62cdb00..2edfd656e4 100644
--- a/src/web/app/mobile/tags/home.tag
+++ b/src/web/app/mobile/tags/home.tag
@@ -16,5 +16,7 @@
this.on('mount', () => {
this.refs.tl.on('loaded', () => {
this.trigger('loaded');
+ });
+ });
</script>
</mk-home>