|
|
@@ -14,7 +14,15 @@ import PdfViewer from '@/components/PDF/PdfViewer'
|
|
|
import { mapState } from 'vuex'
|
|
|
import DiscussionArea from '@/components/Discussion/DiscussionArea'
|
|
|
import { getSlideInfo, getSlideUrl } from '@/server/slide'
|
|
|
-import { FOCUS_ON_INPUT, NEXT_PAGE, PREVIOUS_PAGE, RESET, SET_SRC, USE_FOCUS } from '@/store/types/pdf-types'
|
|
|
+import {
|
|
|
+ FOCUS_ON_INPUT,
|
|
|
+ NEXT_PAGE,
|
|
|
+ PREVIOUS_PAGE,
|
|
|
+ RESET,
|
|
|
+ SET_SRC,
|
|
|
+ TOGGLE_SHOW_DISCUSSION,
|
|
|
+ USE_FOCUS
|
|
|
+} from '@/store/types/pdf-types'
|
|
|
import IconButton from '@/components/Basic/IconButton'
|
|
|
|
|
|
export default {
|
|
|
@@ -52,11 +60,16 @@ export default {
|
|
|
methods: {
|
|
|
handleKey (e) {
|
|
|
if (e.key === 'Enter') {
|
|
|
+ !this.showDiscussion && this.$store.commit(TOGGLE_SHOW_DISCUSSION)
|
|
|
!this.focus && this.$store.commit(FOCUS_ON_INPUT)
|
|
|
return
|
|
|
}
|
|
|
if (e.key === 'Escape') {
|
|
|
- this.focus && this.$store.commit(USE_FOCUS)
|
|
|
+ if (this.focus) {
|
|
|
+ this.$store.commit(USE_FOCUS)
|
|
|
+ } else {
|
|
|
+ this.$store.commit(TOGGLE_SHOW_DISCUSSION)
|
|
|
+ }
|
|
|
return
|
|
|
}
|
|
|
if (!this.showDiscussion || !this.focus) {
|