mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 03:40:00 +08:00
FEATURE: Support keyboard back/forward navigation on DiscourseHub (#12028)
This commit is contained in:
parent
1a159de36f
commit
f2de7842bb
|
@ -1,3 +1,4 @@
|
|||
import { isAppWebview } from "discourse/lib/utilities";
|
||||
import { later, run, schedule, throttle } from "@ember/runloop";
|
||||
import {
|
||||
nextTopicUrl,
|
||||
|
@ -22,6 +23,10 @@ const DEFAULT_BINDINGS = {
|
|||
C: { handler: "focusComposer" },
|
||||
"ctrl+f": { handler: "showPageSearch", anonymous: true },
|
||||
"command+f": { handler: "showPageSearch", anonymous: true },
|
||||
"command+left": { handler: "webviewKeyboardBack" },
|
||||
"command+[": { handler: "webviewKeyboardBack" },
|
||||
"command+right": { handler: "webviewKeyboardForward" },
|
||||
"command+]": { handler: "webviewKeyboardForward" },
|
||||
"mod+p": { handler: "printTopic", anonymous: true },
|
||||
d: { postAction: "deletePost" },
|
||||
e: { postAction: "editPost" },
|
||||
|
@ -788,4 +793,16 @@ export default {
|
|||
toggleAdminActions() {
|
||||
this.appEvents.trigger("topic:toggle-actions");
|
||||
},
|
||||
|
||||
webviewKeyboardBack() {
|
||||
if (isAppWebview()) {
|
||||
window.history.back();
|
||||
}
|
||||
},
|
||||
|
||||
webviewKeyboardForward() {
|
||||
if (isAppWebview()) {
|
||||
window.history.forward();
|
||||
}
|
||||
},
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue
Block a user