diff options
author | Azul <azul@riseup.net> | 2020-06-18 11:38:05 +0300 |
---|---|---|
committer | Azul <azul@riseup.net> | 2020-08-11 16:44:03 +0300 |
commit | a188b74d3c11a0f10b16253d90a578787b30139c (patch) | |
tree | b4973ab7c590319f37fa43456a828fc36da66ff2 /src | |
parent | 5349987621145bb2d3884eddd2e63a3d33fea9d4 (diff) |
Follow links inside the viewer
rather than opening a completely new page
Signed-off-by: Azul <azul@riseup.net>
Diffstat (limited to 'src')
-rw-r--r-- | src/marks/index.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/marks/index.js b/src/marks/index.js index b2658d680..3f33e86cb 100644 --- a/src/marks/index.js +++ b/src/marks/index.js @@ -120,7 +120,10 @@ class Link extends TipTapLink { event.stopPropagation() const htmlHref = event.target.attributes.href.value if (event.button === 0 && !event.ctrlKey && htmlHref.match(/^\?/)) { - window.location = htmlHref + const query = OC.parseQueryString(htmlHref) + const filename = query.relPath.split('/').pop() + const path = `${query.dir}/${filename}` + OCA.Viewer.open({ path }) } else { window.open(htmlHref) } |