Skip to content

Commit

Permalink
fix: autofocus own rich workspaces only at freshly created
Browse files Browse the repository at this point in the history
Signed-off-by: Luka Trovic <luka@nextcloud.com>
  • Loading branch information
luka-nextcloud authored and juliusknorr committed May 5, 2023
1 parent e6a60f1 commit 395a26a
Show file tree
Hide file tree
Showing 14 changed files with 23 additions and 23 deletions.
4 changes: 2 additions & 2 deletions js/editor.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/editor.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/text-editors.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/text-editors.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/text-files.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/text-files.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/text-public.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/text-public.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/text-text.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/text-text.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/text-viewer.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/text-viewer.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/helpers/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ const newRichWorkspaceFileMenuPlugin = {
actionHandler() {
return window.FileList
.createFile(descriptionFile, { scrollTo: false, animate: false })
.then(() => emit('Text::showRichWorkspace'))
.then(() => emit('Text::showRichWorkspace', { autofocus: true }))
},
shouldShow() {
return !fileList.findFile(descriptionFile)
Expand Down
8 changes: 4 additions & 4 deletions src/views/RichWorkspace.vue
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export default {
this.getFileInfo()
})
},
getFileInfo() {
getFileInfo(autofocus) {
this.loaded = false
this.autofocus = false
this.ready = false
Expand All @@ -141,7 +141,7 @@ export default {
this.file = data.file
this.editing = true
this.loaded = true
this.autofocus = true
this.autofocus = autofocus || false
return true
})
.catch((error) => {
Expand All @@ -157,9 +157,9 @@ export default {
return false
})
},
showRichWorkspace() {
showRichWorkspace(event) {
this.enabled = true
this.getFileInfo()
this.getFileInfo(event?.autofocus || false)
},
hideRichWorkspace() {
this.enabled = false
Expand Down

0 comments on commit 395a26a

Please sign in to comment.