Skip to content

Commit

Permalink
Merge pull request 'fix: revert url when editors open in the new tab'…
Browse files Browse the repository at this point in the history
… from hotfix/files-routing into develop

Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/onlyoffice-nextcloud/pulls/35
  • Loading branch information
LinneyS committed Feb 5, 2025
2 parents 3ec8855 + 30109da commit e57fe06
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,10 @@ import NewPdfSvg from '!!raw-loader!../img/new-pdf.svg';
}

if (winEditor && winEditor.location) {
OCA.Onlyoffice.SetDefaultUrl()
winEditor.location.href = url
} else if (!OCA.Onlyoffice.setting.sameTab || OCA.Onlyoffice.mobile || OCA.Onlyoffice.Desktop) {
OCA.Onlyoffice.SetDefaultUrl()
winEditor = window.open(url, '_blank')
} else if ($('#isPublic').val() === '1' && $('#mimetype').val() !== 'httpd/unix-directory') {
location.href = url
Expand Down Expand Up @@ -190,6 +192,10 @@ import NewPdfSvg from '!!raw-loader!../img/new-pdf.svg';

OCA.Onlyoffice.context = null

OCA.Onlyoffice.SetDefaultUrl()
}

OCA.Onlyoffice.SetDefaultUrl = function() {
window.OCP?.Files?.Router?.goToRoute(
null, // use default route
{ view: 'files', fileid: undefined },
Expand Down

0 comments on commit e57fe06

Please sign in to comment.