From 3dc582d1f03abea04ecc2ac4e4b8d7e8527467a9 Mon Sep 17 00:00:00 2001 From: WolverinDEV Date: Sat, 25 May 2019 21:10:25 +0200 Subject: [PATCH] Fixed return key code --- shared/js/ui/client.ts | 2 +- shared/js/ui/elements/modal.ts | 2 +- shared/js/ui/frames/chat.ts | 2 +- shared/js/ui/modal/ModalInvite.ts | 2 +- shared/js/ui/modal/permission/PermissionEditor.ts | 2 +- shared/js/ui/view.ts | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/shared/js/ui/client.ts b/shared/js/ui/client.ts index 949f4a3a..0c4125f7 100644 --- a/shared/js/ui/client.ts +++ b/shared/js/ui/client.ts @@ -881,7 +881,7 @@ class LocalClientEntry extends ClientEntry { _self.renaming = true; elm.keypress(function (e) { - if(e.keyCode == KeyCode.KEY_ENTER) { + if(e.keyCode == KeyCode.KEY_RETURN) { $(this).trigger("focusout"); return false; } diff --git a/shared/js/ui/elements/modal.ts b/shared/js/ui/elements/modal.ts index 84f04f8b..2027fe99 100644 --- a/shared/js/ui/elements/modal.ts +++ b/shared/js/ui/elements/modal.ts @@ -201,7 +201,7 @@ function createInputModal(headMessage: BodyCreator, question: BodyCreator, valid button_submit.prop("disabled", !valid); }); input.on('keydown', event => { - if(event.keyCode !== KeyCode.KEY_ENTER || event.shiftKey) + if(event.keyCode !== KeyCode.KEY_RETURN || event.shiftKey) return; if(button_submit.prop("disabled")) return; diff --git a/shared/js/ui/frames/chat.ts b/shared/js/ui/frames/chat.ts index e9bc26de..31d94dc2 100644 --- a/shared/js/ui/frames/chat.ts +++ b/shared/js/ui/frames/chat.ts @@ -373,7 +373,7 @@ class ChatBox { this._input_message.on('keypress',event => { if(!event.shiftKey) { console.log(event.keyCode); - if(event.keyCode == KeyCode.KEY_ENTER) { + if(event.keyCode == KeyCode.KEY_RETURN) { this.onSend(); return false; } else if(event.keyCode == KeyCode.KEY_UP || event.keyCode == KeyCode.KEY_DOWN) { diff --git a/shared/js/ui/modal/ModalInvite.ts b/shared/js/ui/modal/ModalInvite.ts index ba78c038..b2153c45 100644 --- a/shared/js/ui/modal/ModalInvite.ts +++ b/shared/js/ui/modal/ModalInvite.ts @@ -46,7 +46,7 @@ namespace Modals { flag_resolved_address = input[0].checked; update_link(); }); - input[0].checked = flag_direct_connect; + input[0].checked = flag_resolved_address; } update_link(); diff --git a/shared/js/ui/modal/permission/PermissionEditor.ts b/shared/js/ui/modal/permission/PermissionEditor.ts index 6a32b0d6..dd9d80bb 100644 --- a/shared/js/ui/modal/permission/PermissionEditor.ts +++ b/shared/js/ui/modal/permission/PermissionEditor.ts @@ -898,7 +898,7 @@ namespace ui { }); element.on('keypress', event => { - if(event.which == KeyCode.KEY_ENTER) + if(event.which == KeyCode.KEY_RETURN) element.trigger('focusout'); const text = String.fromCharCode(event.which); diff --git a/shared/js/ui/view.ts b/shared/js/ui/view.ts index c6a2ad84..a55f0832 100644 --- a/shared/js/ui/view.ts +++ b/shared/js/ui/view.ts @@ -750,7 +750,7 @@ class ChannelTree { this.select_next_channel(channel, false); } else if(this.currently_selected instanceof ServerEntry) this.onSelect(this.channel_first, true); - } else if(event.keyCode == KeyCode.KEY_ENTER) { + } else if(event.keyCode == KeyCode.KEY_RETURN) { if(this.currently_selected instanceof ChannelEntry) { this.currently_selected.joinChannel(); }