/* * Codificación UTF-8 * Eventos asociados a generales de una ventana */ /* *********************************************** * MOSTRAR/OCULTAR PANELES *************************************************/ $('button[data-gvhFunction=gvhShowPanel]').on({ click: function(e) { console.log('gvhShowPanel '); e.stopPropagation(); e.stopImmediatePropagation(); var class_button = $(this).hasClass('disabled'); var block = false; if (class_button == false) { var panelAmbito = $(this).attr('data-gvhWindow'); if (panelAmbito == ambito) { var panel = $(this).attr('data-target'); if (block == false) { if ($('#'+panel+'[data-gvhWindow='+panelAmbito+']').is(':hidden')) { $('#'+panel+'[data-gvhWindow='+panelAmbito+']').show('slow'); if (panel == 'P_fil') { $(this).blockExit({ exit: true, modo: 'R', panel: panel }); } block = true; } else if ($('#'+panel+'[data-gvhWindow='+panelAmbito+']').is(':visible')) { $('#'+panel+'[data-gvhWindow='+panelAmbito+']').hide('slow'); block = true; } } } } } }); /* *********************************************** * MOSTRAR/OCULTAR MENSAJE INFORMATIVO *************************************************/ $('a[data-gvhFunction=infoContenedor]').on({ click: function() { e.stopPropagation(); e.stopImmediatePropagation(); var panelAmbito = $(this).attr('data-gvhwindow'); var target_button = $(this).attr('data-target'); var $target = $( target_button ); if ($('#'+target+'[data-gvhWindow='+panelAmbito+']').is(':hidden')) { $target.show(); } else if ($('#'+target+'[data-gvhWindow='+panelAmbito+']').is(':visible')) { $target.hide(); } } }); /* *********************************************** * MENSAJES CUANDO HAY CAMBIOS PENDIENTES *************************************************/ //Mensaje de aviso cuando se vuelve a la pantalla principal de la aplicación $('button[id=home]').on({ click: function() { //var estadoPanel = $('#gvhMain').attr('data-gvhestadopanel'); //if (estadoPanel == 'R') gvhExit = $(this).attr('data-gvhExit'); if ((gvhExit == true) || (gvhExit == 'true')) { $(location).attr('href','phrame.php?action=volverPrincipal'); } else { $(this).showMessage('gvhlang_msjUI','alert'); } } }); // Mensaje de aviso cuando se vuelve a la pantalla principal de la aplicación $('button[id=close]').on({ click: function() { inicio = $(this).attr('data-gvhInicio'); //var estadoPanel = $('#gvhMain').attr('data-gvhestadopanel'); //if ((estadoPanel == 'R') || (inicio == 'true')) gvhExit = $(this).attr('data-gvhExit'); if (((inicio == true) || (inicio == 'true')) || ((gvhExit == true) || (gvhExit == 'true'))) { $(this).controllerJS({ id: $(this).attr('id'), panel: '', destino: $(this).attr('data-gvhDestino'), newWindow: 'false', confirm: '', claseM: '' }) } else { $(this).showMessage('gvhlang_msjUI','alert'); } } }); /* Idioma */ $('a[data-gvhFunction=language]').on({ click: function() { $(this).controllerJS({ id: $(this).attr('id'), panel: '', destino: $(this).attr('data-gvhDestino'), newWindow: 'false', confirm: '', claseM: '' }) } }); $('div[id=capa_menuFalso]').on({ click: function() { $(this).showMessage('gvhlang_msjUI','alert'); } }); $('[data-gvhOpenWindow]').on({ click: function() { var size = $(this).attr('data-gvhSizeWindow'); // w,h vSize = size.split(','); $(this).popupWindow({ windowURL: $(this).attr('data-gvhOpenWindow'), scrollbars: 1, centerScreen: 1, height: vSize[1], width: vSize[0], windowName:'newWindow' }); } }); $(document).ready(function() { $('[data-toggle="popover"]').each(function () { $(this).popover({ trigger: 'manual', content: $(this).attr('data-content'), html: true }); }) }); /************************************/ /* CERRAMOS TODOS LOS cwinformation */ $('body').on({ click: function(e) { $('[data-toggle="popover"]').each(function () { if (!$(this).is(e.target) && $(this).has(e.target).length === 0 && $('.popover').has(e.target).length === 0) { $(this).popover('hide'); } }); } });