Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix opening editors in new tab #4500

Merged
merged 2 commits into from
Dec 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions apps/files/src/mixins/fileActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,17 +84,16 @@ export default {
name: editor.routeName,
params: { filePath: filePath }
}).href
const url = window.location.origin + '/' + path
const target = `${editor.routeName}-${filePath}`
const win = window.open(url, target)
const win = window.open(path, target)
// in case popup is blocked win will be null
if (win) {
win.focus()
}
return
}

const routeName = editor.routeName ? editor.app + '/' + editor.routeName : editor.app
const routeName = editor.routeName || editor.app
const params = {
filePath,
contextRouteName: this.$route.name
Expand Down
14 changes: 7 additions & 7 deletions apps/media-viewer/src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const appInfo = {
extensions: [
{
extension: 'png',
routeName: 'media',
routeName: 'mediaviewer/media',
routes: [
'files-list',
'files-favorites',
Expand All @@ -32,7 +32,7 @@ const appInfo = {
},
{
extension: 'jpg',
routeName: 'media',
routeName: 'mediaviewer/media',
routes: [
'files-list',
'files-favorites',
Expand All @@ -43,7 +43,7 @@ const appInfo = {
},
{
extension: 'jpeg',
routeName: 'media',
routeName: 'mediaviewer/media',
routes: [
'files-list',
'files-favorites',
Expand All @@ -54,7 +54,7 @@ const appInfo = {
},
{
extension: 'gif',
routeName: 'media',
routeName: 'mediaviewer/media',
routes: [
'files-list',
'files-favorites',
Expand All @@ -65,7 +65,7 @@ const appInfo = {
},
{
extension: 'mp4',
routeName: 'media',
routeName: 'mediaviewer/media',
routes: [
'files-list',
'files-favorites',
Expand All @@ -76,7 +76,7 @@ const appInfo = {
},
{
extension: 'webm',
routeName: 'media',
routeName: 'mediaviewer/media',
routes: [
'files-list',
'files-favorites',
Expand All @@ -87,7 +87,7 @@ const appInfo = {
},
{
extension: 'ogg',
routeName: 'media',
routeName: 'mediaviewer/media',
routes: [
'files-list',
'files-favorites',
Expand Down
5 changes: 5 additions & 0 deletions changelog/unreleased/editors-new-tab
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Bugfix: Do not use origin location to open editors

When opening the editors view in a new tab, we were using the origin of location. This would break in case we have Web deployed to a different path than root e.g. `http://owncloud/apps/web`.

https://github.com/owncloud/web/pull/4500