Commit of UI changes:

- Enhanced delete function for users and domains (soon for all)
- Fixed NavBar/Search bar quirks for smaller screens
- Fixed Functions Row display for smaller screens, generally cleaner look

Tested on IE8-10 (with IE Tester), latest versions of Firefox, Chrome.  Will soon test on Android and Apple devices.
This commit is contained in:
Remi S
2013-08-06 10:35:00 -04:00
parent 33871b21b7
commit 30388bd1c3
17 changed files with 269 additions and 132 deletions

View File

@ -1072,5 +1072,52 @@ $.datepicker.setDefaults($.datepicker.regional[Piler.piler_ui_lang]);
});
// modal additions
$(document).on("click", ".confirm-delete", function (e) {
e.preventDefault();
var id = $(this).data('id'),
name = $(this).data('name'),
url = $(".modal-footer #id").attr("href");
//set id
url = UpdateQueryString('id',id,url);
//set name
url = UpdateQueryString('name',name,url);
//set confirmation
url = UpdateQueryString('confirmed',1,url);
//set href
$(".modal-footer #id").attr("href",url);
//set display text
$(".modal-body #name").html( name );
//finally, display the confirm modal box
$('#deleteconfirm-modal').modal('show');
});
function UpdateQueryString(key, value, url) { // from http://stackoverflow.com/questions/5999118/add-or-update-query-string-parameter/11654596#11654596
if (!url) url = window.location.href;
var re = new RegExp("([?|&])" + key + "=.*?(&|#|$)(.*)", "gi");
if (re.test(url)) {
if (typeof value !== 'undefined' && value !== null)
return url.replace(re, '$1' + key + "=" + value + '$2$3');
else {
return url.replace(re, '$1$3').replace(/(&|\?)$/, '');
}
}
else {
if (typeof value !== 'undefined' && value !== null) {
var separator = url.indexOf('?') !== -1 ? '&' : '?',
hash = url.split('#');
url = hash[0] + separator + key + '=' + value;
if (hash[1]) url += '#' + hash[1];
return url;
}
else
return url;
}
}