From 347802a4b60419a017c74a6164a0f3b185554580 Mon Sep 17 00:00:00 2001 From: Tim Miller-Williams Date: Thu, 7 Nov 2019 23:43:28 +0000 Subject: [PATCH] Refactor Apple keyboard logic to be more explicit --- client/components/Windows/Help.vue | 53 ++++++++++++++++-------------- client/css/style.css | 9 ----- client/js/vue.js | 4 --- 3 files changed, 29 insertions(+), 37 deletions(-) diff --git a/client/components/Windows/Help.vue b/client/components/Windows/Help.vue index 03794828..1ffb0d82 100644 --- a/client/components/Windows/Help.vue +++ b/client/components/Windows/Help.vue @@ -97,8 +97,8 @@
- Alt Shift - + Alt Shift +

Switch to the next lobby in the channel list.

@@ -107,8 +107,8 @@
- Alt Shift - + Alt Shift +

Switch to the previous lobby in the channel list.

@@ -117,8 +117,8 @@
- Alt - + Alt +

Switch to the next window in the channel list.

@@ -127,8 +127,8 @@
- Alt - + Alt +

Switch to the previous window in the channel list.

@@ -137,8 +137,8 @@
- Alt A - A + Alt A + A

Switch to the first window with unread messages.

@@ -147,8 +147,8 @@
- Ctrl K - K + Ctrl K + K

@@ -176,8 +176,8 @@

- Ctrl B - B + Ctrl B + B

@@ -189,8 +189,8 @@

- Ctrl U - U + Ctrl U + U

@@ -202,8 +202,8 @@

- Ctrl I - I + Ctrl I + I

@@ -215,8 +215,8 @@

- Ctrl S - S + Ctrl S + S

@@ -228,8 +228,8 @@

- Ctrl M - M + Ctrl M + M

@@ -241,8 +241,8 @@

- Ctrl O - O + Ctrl O + O

@@ -694,5 +694,10 @@ export default { SidebarToggle, VersionChecker, }, + data() { + return { + isApple: navigator.platform.match(/(Mac|iPhone|iPod|iPad)/i) || false, + }; + }, }; diff --git a/client/css/style.css b/client/css/style.css index fce2f5ca..6c687ab2 100644 --- a/client/css/style.css +++ b/client/css/style.css @@ -1904,15 +1904,6 @@ part/quit messages where we don't load previews (adds a blank line otherwise) */ margin-bottom: 0; } -.is-apple #help .key-all, -#help .key-apple { - display: none; -} - -.is-apple #help .key-apple { - display: inline-block; -} - .whois { display: grid; grid-template-columns: max-content auto; diff --git a/client/js/vue.js b/client/js/vue.js index 9484e86a..adf6e6e2 100644 --- a/client/js/vue.js +++ b/client/js/vue.js @@ -17,10 +17,6 @@ const vueApp = new Vue({ el: "#viewport", router, mounted() { - if (navigator.platform.match(/(Mac|iPhone|iPod|iPad)/i)) { - document.body.classList.add("is-apple"); - } - document.addEventListener("visibilitychange", this.synchronizeNotifiedState); document.addEventListener("focus", this.synchronizeNotifiedState); document.addEventListener("click", this.synchronizeNotifiedState);