diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/helpers/links.js | 3 | ||||
-rw-r--r-- | src/tests/helpers/links.spec.js | 13 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/helpers/links.js b/src/helpers/links.js index 3a2918863..5d7ecbf7e 100644 --- a/src/helpers/links.js +++ b/src/helpers/links.js @@ -58,8 +58,7 @@ const domHref = function(node) { const match = ref.match(/^([^?]*)\?fileId=(\d+)/) if (match) { const [, relPath, id] = match - const currentDir = OC.Util.History.parseUrlQuery().dir - || basedir(OCA.Viewer.state.file) + const currentDir = basedir(OCA.Viewer.state.file) const dir = absolutePath(currentDir, basedir(relPath)) return generateUrl(`/apps/files/?dir=${dir}&openfile=${id}#relPath=${relPath}`) } diff --git a/src/tests/helpers/links.spec.js b/src/tests/helpers/links.spec.js index a72072fd9..426d80f6a 100644 --- a/src/tests/helpers/links.spec.js +++ b/src/tests/helpers/links.spec.js @@ -1,13 +1,14 @@ import { domHref, parseHref } from '../../helpers/links' -global.OC = { - Util: { - History: { - parseUrlQuery: () => ({ - dir: '/Wiki', - }), +global.OCA = { + Viewer: { + state: { + file: '/Wiki/file.md', }, }, +} + +global.OC = { config: {modRewriteWorking: true}, webroot: '' } |