Commit 6690a1ba authored by Jerome Mariette's avatar Jerome Mariette
Browse files

No commit message

No commit message
parent a442f6d6
......@@ -43,6 +43,16 @@ $(function () {
}
}
/*
* Does the string ends with the specified pattern
* @param str the string to test
* @param pattern the pattern to test
* @return boolean True if str ends with the specified pattern, False otherwise
*/
function endsWith(str, pattern) {
return (str.match(pattern+"$")==pattern);
}
// Grab relevant info from URL fragment
var params = simpleQueryParams(location.href),
active_tab = params["active_tab"];
......@@ -649,8 +659,9 @@ $(function () {
if(val == '0'){
$("#user_information_dialog").dialog("close");
location.assign(location.href+"&active_tab=users");
if (!endsWith(location.href, "active_tab=users")) {
location.assign(location.href+"&active_tab=users");
}
var res_buttons = {};
res_buttons[$("#ok_btn_label").val()] = function(){$(this).dialog("close");};
$("#user_information_dialog").dialog('option', 'buttons', res_buttons);
......@@ -679,7 +690,9 @@ $(function () {
url: val_url,
success: function(val_p, status_p, xhr_p) {
$(this).dialog("close");
location.assign(location.href+"&active_tab=users");
if (!endsWith(location.href, "active_tab=users")) {
location.assign(location.href+"&active_tab=users");
}
}
});
......@@ -1180,7 +1193,9 @@ $(function () {
$("#user_information_dialog").dialog("option", "width", original_widht);
$("#user_information_dialog").dialog("option", "height", original_height);
$("#user_information_dialog").dialog("close");
location.assign(location.href+"&active_tab=users");
if (!endsWith(location.href, "active_tab=users")) {
location.assign(location.href+"&active_tab=users");
}
}
}
});
......@@ -1200,7 +1215,9 @@ $(function () {
$.ajax({
url: val_url,
success: function(val, status, xhr) {
location.assign(location.href+"&active_tab=users");
if (!endsWith(location.href, "active_tab=users")) {
location.assign(location.href+"&active_tab=users");
}
}
});
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment