File tree Expand file tree Collapse file tree 3 files changed +24
-22
lines changed
layouts/PagesLayout/MainContent/DisplayUI Expand file tree Collapse file tree 3 files changed +24
-22
lines changed Original file line number Diff line number Diff line change @@ -149,6 +149,10 @@ export function useKeyboardShortcuts() {
149149 return true ;
150150 }
151151
152+ if ( event . code === 'Backspace' && activeElem == null ) {
153+ await internals . pages . goBackward ( ) ;
154+ return true ;
155+ }
152156 if ( event . code === 'Backspace' && activeElem != null ) {
153157 await page . editing . start ( activeElem ) ;
154158 page . editing . react . editor ?. commands . deleteSelection ( ) ;
Original file line number Diff line number Diff line change @@ -109,7 +109,7 @@ export class Pages {
109109 }
110110
111111 async setupPage ( pageId : string ) {
112- internals . pages . react . page ?. deactivate ( ) ;
112+ this . react . page ?. deactivate ( ) ;
113113
114114 let page ;
115115
@@ -121,7 +121,7 @@ export class Pages {
121121 this . pageCache . add ( page ) ;
122122 }
123123
124- internals . pages . react . page = page ;
124+ this . react . page = page ;
125125
126126 pagesStore ( ) . loading = false ;
127127
@@ -231,6 +231,22 @@ export class Pages {
231231 }
232232 }
233233
234+ async goBackward ( ) {
235+ await this . goToPage (
236+ this . react . pathPageIds [
237+ this . react . pathPageIds . indexOf ( this . react . pageId ! ) - 1
238+ ] ,
239+ ) ;
240+ }
241+
242+ async goForward ( ) {
243+ await this . goToPage (
244+ this . react . pathPageIds [
245+ this . react . pathPageIds . indexOf ( this . react . pageId ! ) + 1
246+ ] ,
247+ ) ;
248+ }
249+
234250 destroy ( ) {
235251 for ( const page of this . pageCache . react . cache ) {
236252 page . destroy ( ) ;
Original file line number Diff line number Diff line change 77 :disable ="
88 internals.pages.react.pageId === internals.pages.react.pathPageIds[0]
99 "
10- @click =" goBackward()"
10+ @click =" internals.pages. goBackward()"
1111 >
1212 <q-tooltip
1313 anchor =" center right"
2929 internals.pages.react.pageId ===
3030 internals.pages.react.pathPageIds.at(-1)
3131 "
32- @click =" goForward()"
32+ @click =" internals.pages. goForward()"
3333 >
3434 <q-tooltip
3535 anchor =" center right"
8888import TakeScreenshotDialog from ' ../../MainToolbar/TakeScreenshotDialog.vue' ;
8989
9090const page = computed (() => internals .pages .react .page );
91-
92- async function goBackward() {
93- await internals .pages .goToPage (
94- internals .pages .react .pathPageIds [
95- internals .pages .react .pathPageIds .indexOf (internals .pages .react .pageId ! ) -
96- 1
97- ],
98- );
99- }
100-
101- async function goForward() {
102- await internals .pages .goToPage (
103- internals .pages .react .pathPageIds [
104- internals .pages .react .pathPageIds .indexOf (internals .pages .react .pageId ! ) +
105- 1
106- ],
107- );
108- }
10991 </script >
11092
11193<style lang="scss" scoped>
You can’t perform that action at this time.
0 commit comments