Fix Sub-Account Manager when used through P2P
parent
069c91d3cc
commit
4ceb8bb981
|
|
@ -74,8 +74,10 @@ function base64ArrayBuffer(arrayBuffer) {
|
|||
function getLocationPathName(){
|
||||
return location.pathname.endsWith('/') ? location.pathname : location.pathname + '/'
|
||||
}
|
||||
function getFullOrigin(){
|
||||
return location.origin + getLocationPathName()
|
||||
function getFullOrigin(withoutTrailingSlash){
|
||||
var url = location.origin + getLocationPathName()
|
||||
if(withoutTrailingSlash)url = url.slice(0, -1);
|
||||
return url
|
||||
}
|
||||
function debugLog(...args){
|
||||
console.log(...args)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
$(document).ready(function(){
|
||||
var apiPrefix = getAdminApiPrefix()
|
||||
var apiPrefix = getFullOrigin(true) + getAdminApiPrefix()
|
||||
var theWindow = $('#subAccountManager');
|
||||
var accountTable = $('#subAccountsList tbody');
|
||||
var theWindowForm = $('#monSectionAccountInformation');
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@
|
|||
if(!details.sub){ %>
|
||||
<script>
|
||||
window.getAdminApiPrefix = function(piece){
|
||||
return location.search === '?p2p=1' ? (location.pathname.endsWith('/') ? location.pathname : location.pathname) : "<%=originalURL%><%=config.webPaths.adminApiPrefix%><%- $user.auth_token %>/"
|
||||
return "<%=originalURL%><%=config.webPaths.adminApiPrefix%><%- $user.auth_token %>/"
|
||||
}
|
||||
</script>
|
||||
<% }
|
||||
|
|
|
|||
Loading…
Reference in New Issue