Save active tab in cookie in order to restore after page refresh

This commit is contained in:
Malishev Dmitry 2011-09-02 21:38:27 +03:00
parent 0f2c093148
commit f651c68a6a
9 changed files with 99 additions and 65 deletions

View file

@ -264,3 +264,26 @@ App.Helpers.closeInnerPopup = function(evt)
{
$('#inner-popup').remove();
}
App.Helpers.getBackendUrl = function()
{
var url_parts = location.href.split('#');
if (url_parts.length > 1) {
var tab = url_parts[url_parts.length - 1];
if ($.inArray(tab, App.Constants.TABS) != -1) {
App.Tmp.loadTAB = tab;
}
}
var url_parts = location.href.split('?', 1);
var url = url_parts[0];
url_parts = url.split('/');
if (url_parts[url_parts.length -1] == 'index.html') {
url_parts[url_parts.length -1] = 'dispatch.php';
}
else {
url_parts.push('dispatch.php');
}
return url_parts.join('/');
}