Skip to content

Commit 667001f

Browse files
authored
Merge pull request #2326 from nextcloud/backport/2322/stable29
[stable29] Properly save old route when opening the viewer
2 parents 9efeaba + 43bf44e commit 667001f

4 files changed

Lines changed: 5 additions & 4 deletions

File tree

css/viewer-index.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/viewer-main.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ var b4=Object.defineProperty;var y4=(e,r,a)=>r in e?b4(e,r,{enumerable:!0,config
425425
* You should have received a copy of the GNU Affero General Public License
426426
* along with this program. If not, see <http://www.gnu.org/licenses/>.
427427
*
428-
*/function Pj(e,r,a){const n="".concat(e.dirname,"/").concat(e.basename).replace(/^\/\//,"/"),i=[window.OCP.Files.Router.name,window.OCP.Files.Router.params,window.OCP.Files.Router.query,!0],s=()=>window.OCP.Files.Router.goToRoute(...i);ah(e,r,a),OCA.Viewer.open({path:n,onPrev:ah,onNext:ah,onClose:s})}function ah(e,r,a){window.OCP.Files.Router.goToRoute(null,{view:r.id,fileid:e.fileid},{dir:a,openfile:!0},!0)}/**
428+
*/function Pj(e,r,a){const n="".concat(e.dirname,"/").concat(e.basename).replace(/^\/\//,"/"),i=[window.OCP.Files.Router.name,{...window.OCP.Files.Router.params},{...window.OCP.Files.Router.query},!0],s=()=>window.OCP.Files.Router.goToRoute(...i);ah(e,r,a),OCA.Viewer.open({path:n,onPrev:ah,onNext:ah,onClose:s})}function ah(e,r,a){window.OCP.Files.Router.goToRoute(null,{view:r.id,fileid:e.fileid},{dir:a,openfile:!0},!0)}/**
429429
* @copyright Copyright (c) 2020 Azul <azul@riseup.net>
430430
*
431431
* @author Azul <azul@riseup.net>

js/viewer-main.mjs.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/services/FilesActionHandler.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ export default function(node, view, dir) {
3030
const path = `${node.dirname}/${node.basename}`.replace(/^\/\//, '/')
3131
const oldRoute = [
3232
window.OCP.Files.Router.name,
33-
window.OCP.Files.Router.params,
34-
window.OCP.Files.Router.query,
33+
{ ...window.OCP.Files.Router.params },
34+
{ ...window.OCP.Files.Router.query },
3535
true,
3636
]
3737
const onClose = () => window.OCP.Files.Router.goToRoute(...oldRoute)

0 commit comments

Comments
 (0)