Liberacion

This commit is contained in:
fjrodriguez
2024-02-01 11:41:05 -06:00
parent 83ece0be43
commit 98a58d5eea
13 changed files with 201 additions and 112 deletions

View File

@@ -0,0 +1,32 @@
<script>
document.addEventListener("DOMContentLoaded", ()=>{
document.querySelector('#add-sistema-cliente').addEventListener('click', function() {
let parentWidth = window.innerWidth;
let parentHeight = window.innerHeight;
let childWidth = 800;
let childHeight = 600;
let left =(parentWidth - childWidth);
let top = (parentHeight - childHeight);
let popupWin = window.open("{% url 'create_sistemaIMMEX' %}", "createSistemaXCliente_popup", "width=" + childWidth + ",height=" + childHeight + ",left=" + left + ",top=" + top);
popupWin.focus();
});
window.addEventListener('message', (event)=>{
let response = event.data.data;
let windowName = event.data.windowName;
if(windowName==='createSistemaXCliente'){
let option = '<option value="' + response.id + '" selected>'+response.cliente+', ' + response.nombre + '</option>';
document.querySelector('#id_sistema_cliente').insertAdjacentHTML('beforeend', option);
}
});
});
</script>