get_base_url fix

if url contains the 'desk' then the get_base_url function was removes the desk from url
e.g. if url is www.helpdesk.com/desk then get_base_url() returns <b>http://help</b> instead of
<b>http://www.helpdesk.com</b>
This commit is contained in:
Makarand Bauskar 2015-12-28 12:40:56 +05:30
parent 425c00ca53
commit dfc787a0b9

View file

@ -180,7 +180,8 @@ frappe.urllib = {
// returns the base url with http + domain + path (-index.cgi or # or ?)
get_base_url: function() {
var url= (frappe.base_url || window.location.href).split('#')[0].split('?')[0].split('desk')[0];
// var url= (frappe.base_url || window.location.href).split('#')[0].split('?')[0].split('desk')[0];
var url = (frappe.base_url || window.location.origin)
if(url.substr(url.length-1, 1)=='/') url = url.substr(0, url.length-1)
return url
},