/* * Codificación UTF-8 * Eventos asociados a generales de una ventana */ /* *********************************************** * MOSTRAR/OCULTAR PANELES *************************************************/ $('button[data-gvhFunction=showPanel]').on({ click: function(e) { var class_button = $(this).hasClass('disabled'); if (class_button == false) { var panelAmbito = $(this).attr('data-gvhwindow'); var panel = $(this).attr('data-target'); if ($('#'+panel+'[data-gvhWindow='+panelAmbito+']').is(':hidden')) { $('#'+panel+'[data-gvhWindow='+panelAmbito+']').show('slow'); } else if ($('#'+panel+'[data-gvhWindow='+panelAmbito+']').is(':visible')) { $('#'+panel+'[data-gvhWindow='+panelAmbito+']').hide('slow'); } } } }); /* *********************************************** * MOSTRAR/OCULTAR MENSAJE INFORMATIVO *************************************************/ $('a[data-gvhFunction=infoContenedor]').on({ click: function() { 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') { $(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')) { $(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' }); } }); /************************************/ /* 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'); } }); } });