Замена event.code на event.key
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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();
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user