parent
44ea432bbf
commit
b5cfbe4c08
|
@ -138,7 +138,7 @@ class Adapter {
|
||||||
} else {
|
} else {
|
||||||
// encodes but retains the slashes, see #274
|
// encodes but retains the slashes, see #274
|
||||||
const encodedPath = path.split('/').map(encodeURIComponent).join('/')
|
const encodedPath = path.split('/').map(encodeURIComponent).join('/')
|
||||||
const url = this._getItemHref(repo, type, encodedPath)
|
const url = this._getItemHref(repo, type, encodedPath, opts.encodedBranch)
|
||||||
item.a_attr = {
|
item.a_attr = {
|
||||||
href: url,
|
href: url,
|
||||||
'data-download-url': url,
|
'data-download-url': url,
|
||||||
|
@ -371,8 +371,8 @@ class Adapter {
|
||||||
* Returns item's href value.
|
* Returns item's href value.
|
||||||
* @api protected
|
* @api protected
|
||||||
*/
|
*/
|
||||||
_getItemHref(repo, type, encodedPath) {
|
_getItemHref(repo, type, encodedPath, encodedBranch) {
|
||||||
return `/${repo.username}/${repo.reponame}/${type}/${repo.branch}/${encodedPath}`
|
return `/${repo.username}/${repo.reponame}/${type}/${encodedBranch}/${encodedPath}`
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Returns patch's href value.
|
* Returns patch's href value.
|
||||||
|
|
|
@ -202,7 +202,7 @@ class Bitbucket extends PjaxAdapter {
|
||||||
}
|
}
|
||||||
|
|
||||||
// @override
|
// @override
|
||||||
_getItemHref(repo, type, encodedPath) {
|
_getItemHref(repo, type, encodedPath, encodedBranch) {
|
||||||
return `/${repo.username}/${repo.reponame}/src/${repo.branch}/${encodedPath}`
|
return `/${repo.username}/${repo.reponame}/src/${encodedBranch}/${encodedPath}`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue