WebHostal/war/js/GlobalJs.js
Araozu 3750096e23 Funcionalidad lista al 100%:
-El método que revisa el acceso a un servlet se encuentra en el método checkPermission en controller.access.AccessControllerView
-Ahora agregaré cosas al Front-end.
2018-06-24 19:38:59 -05:00

38 lines
1.1 KiB
JavaScript

var dropdownOpen = false;
var dropdown = document.getElementById("dropdownContent");
function toggleDropdown() {
(dropdownOpen)? dropdown.style.maxHeight = "0": dropdown.style.maxHeight = "300px";
dropdownOpen = !dropdownOpen;
}
var userOptions = document.getElementById("userOptions");
var isUserOptionsEnable = true;
document.getElementById("cerrar").addEventListener("click", changeUserOptions());
function changeUserOptions() {
if (isUserOptionsEnable){
userOptions.style.display = "none";
} else {
userOptions.style.display = "block";
}
isUserOptionsEnable = !isUserOptionsEnable;
}
function postRedirect(url, postData){
var postForm = document.createElement("form");
postForm.action = url;
postForm.method = "POST";
postForm.style.display = "none";
for (var key in postData){
if (postData.hasOwnProperty(key)){
var input = document.createElement("input");
input.type = "hidden";
input.name = key;
input.value = postData[key];
postForm.appendChild(input);
}
}
document.body.appendChild(postForm);
postForm.submit();
}