Skip to content

Commit 01e8289

Browse files
committed
text-editor: small fixes
dirty fixes, needs cleanup
1 parent 4185085 commit 01e8289

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

text-editor/src/TextEditorAppBar.vue

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<oc-spinner v-if="isLoading" :aria-label="$gettext('Loading editor content')" />
1313
</div>
1414
<div class="oc-width-expand oc-text-center">
15-
<span id="text-editor-file-path">{{ currentFile }}</span>
15+
<span id="text-editor-file-path">{{ fileCleaned }}</span>
1616
</div>
1717
<div class="oc-width-auto oc-text-right">
1818
<oc-button id="text-editor-controls-close" @click="closeApp">
@@ -35,20 +35,27 @@ export default {
3535
'currentFile',
3636
'isPublicLink',
3737
'plToken'
38-
])
38+
]),
39+
fileCleaned() {
40+
41+
return this.currentFile.split('/').pop()
42+
}
3943
},
4044
methods: {
4145
...mapActions('Text Editor', ['saveFile']),
4246
closeApp() {
43-
const folderPath = this.currentFile.substring(0, this.currentFile.lastIndexOf('/'))
44-
4547
if (this.isPublicLink) {
48+
const folderPath = this.currentFile.substring(0, this.currentFile.lastIndexOf('/'))
4649
this.$router.push({
47-
path: '/files/public/list/' + this.plToken + folderPath
50+
path: '/files/public/show/' + this.plToken + folderPath
4851
})
4952
} else {
53+
let folderPath = this.currentFile.split('/')
54+
folderPath.splice(0, 3)
55+
folderPath.pop()
56+
folderPath = folderPath.join('/')
5057
this.$router.push({
51-
path: '/files/list/all' + folderPath
58+
path: '/files/spaces/personal/home/' + folderPath
5259
})
5360
}
5461
},

0 commit comments

Comments
 (0)