Liberacion
This commit is contained in:
32
Templates/IMMEX/modulos/add_SistemaXCliente_Script.html
Normal file
32
Templates/IMMEX/modulos/add_SistemaXCliente_Script.html
Normal 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>
|
||||
Reference in New Issue
Block a user