Преглед изворни кода

Замена event.code на event.key

Book Pauk пре 4 година
родитељ
комит
3109104928

+ 2 - 2
client/components/ExternalLibs/ExternalLibs.vue

@@ -499,12 +499,12 @@ class ExternalLibs extends Vue {
 
 
             //недостатки сторонних ui
             //недостатки сторонних ui
             const input = this.$refs.input.$refs.input;
             const input = this.$refs.input.$refs.input;
-            if (document.activeElement === input && event.type == 'keydown' && event.code == 'Enter') {
+            if (document.activeElement === input && event.type == 'keydown' && event.key == 'Enter') {
                 this.submitUrl();
                 this.submitUrl();
                 return true;
                 return true;
             }
             }
 
 
-            if (event.type == 'keydown' && (event.code == 'Escape')) {
+            if (event.type == 'keydown' && event.key == 'Escape') {
                 this.close();
                 this.close();
             }
             }
             return true;
             return true;

+ 1 - 1
client/components/Reader/CopyTextPage/CopyTextPage.vue

@@ -95,7 +95,7 @@ class CopyTextPage extends Vue {
     }
     }
 
 
     keyHook(event) {
     keyHook(event) {
-        if (event.type == 'keydown' && (event.code == 'Escape')) {
+        if (event.type == 'keydown' && event.key == 'Escape') {
             this.close();
             this.close();
         }
         }
         return true;
         return true;

+ 1 - 1
client/components/Reader/HelpPage/HelpPage.vue

@@ -81,7 +81,7 @@ class HelpPage extends Vue {
     }
     }
 
 
     keyHook(event) {
     keyHook(event) {
-        if (event.type == 'keydown' && (event.code == 'Escape')) {
+        if (event.type == 'keydown' && event.key == 'Escape') {
             this.close();
             this.close();
         }
         }
         return true;
         return true;

+ 1 - 1
client/components/Reader/LoaderPage/LoaderPage.vue

@@ -173,7 +173,7 @@ class LoaderPage extends Vue {
 
 
         //недостатки сторонних ui
         //недостатки сторонних ui
         const input = this.$refs.input.$refs.input;
         const input = this.$refs.input.$refs.input;
-        if (document.activeElement === input && event.type == 'keydown' && event.code == 'Enter') {
+        if (document.activeElement === input && event.type == 'keydown' && event.key == 'Enter') {
             this.submitUrl();
             this.submitUrl();
             return true;
             return true;
         }
         }

+ 1 - 1
client/components/Reader/LoaderPage/PasteTextPage/PasteTextPage.vue

@@ -78,7 +78,7 @@ class PasteTextPage extends Vue {
 
 
     keyHook(event) {
     keyHook(event) {
         if (event.type == 'keydown') {
         if (event.type == 'keydown') {
-            switch (event.code) {
+            switch (event.key) {
                 case 'F2':
                 case 'F2':
                     this.loadBuffer();
                     this.loadBuffer();
                     break;
                     break;

+ 1 - 1
client/components/Reader/RecentBooksPage/RecentBooksPage.vue

@@ -341,7 +341,7 @@ class RecentBooksPage extends Vue {
     }
     }
 
 
     keyHook(event) {
     keyHook(event) {
-        if (!this.$root.stdDialog.active && event.type == 'keydown' && event.code == 'Escape') {
+        if (!this.$root.stdDialog.active && event.type == 'keydown' && event.key == 'Escape') {
             this.close();
             this.close();
         }
         }
         return true;
         return true;

+ 1 - 1
client/components/Reader/SearchPage/SearchPage.vue

@@ -174,7 +174,7 @@ class SearchPage extends Vue {
     }
     }
 
 
     keyHook(event) {
     keyHook(event) {
-        if (event.type == 'keydown' && (event.code == 'Escape')) {
+        if (event.type == 'keydown' && event.key == 'Escape') {
             this.close();
             this.close();
         }
         }
         return true;
         return true;

+ 1 - 1
client/components/Reader/SetPositionPage/SetPositionPage.vue

@@ -60,7 +60,7 @@ class SetPositionPage extends Vue {
     keyHook(event) {
     keyHook(event) {
         if (event.type == 'keydown') {
         if (event.type == 'keydown') {
             const action = this.$root.readerActionByKeyEvent(event);
             const action = this.$root.readerActionByKeyEvent(event);
-            if (event.code == 'Escape' || action == 'setPosition') {
+            if (event.key == 'Escape' || action == 'setPosition') {
                 this.close();
                 this.close();
             }
             }
         }
         }

+ 1 - 1
client/components/Reader/SettingsPage/SettingsPage.vue

@@ -499,7 +499,7 @@ class SettingsPage extends Vue {
     }
     }
 
 
     keyHook(event) {
     keyHook(event) {
-        if (!this.$root.stdDialog.active && event.type == 'keydown' && event.code == 'Escape') {
+        if (!this.$root.stdDialog.active && event.type == 'keydown' && event.key == 'Escape') {
             this.close();
             this.close();
         }
         }
         return true;
         return true;

+ 2 - 2
client/components/share/StdDialog.vue

@@ -284,12 +284,12 @@ class StdDialog extends Vue {
                     handled = true;
                     handled = true;
                 }
                 }
             } else {
             } else {
-                if (event.code == 'Enter') {
+                if (event.key == 'Enter') {
                     this.okClick();
                     this.okClick();
                     handled = true;
                     handled = true;
                 }
                 }
 
 
-                if (event.code == 'Escape') {
+                if (event.key == 'Escape') {
                     this.$nextTick(() => {
                     this.$nextTick(() => {
                         this.$refs.dialog.hide();
                         this.$refs.dialog.hide();
                     });
                     });