Risoluzione di un bug nei tab

Risoluzione di una problematica con i tab dei plugin all'interno dei moduli.
This commit is contained in:
Thomas Zilio 2017-10-08 18:28:26 +02:00
parent fb6b12b97d
commit 86bac71fb1
5 changed files with 19 additions and 20 deletions

1
.gitignore vendored
View File

@ -82,3 +82,4 @@ files/my_impianti/*
!files/my_impianti/componente.ini
config.inc.php
REVISION
.php_cs.cache

View File

@ -27,7 +27,7 @@ echo Widgets::addModuleWidgets($id_module, 'controller_top');
// Lettura eventuali plugins modulo da inserire come tab
echo '
<div class="nav-tabs-custom">
<ul class="nav nav-tabs pull-right" role="tablist">
<ul class="nav nav-tabs pull-right" id="tabs" role="tablist">
<li class="pull-left active header">';
// Verifico se ho impostato un nome modulo personalizzato

View File

@ -54,7 +54,7 @@ if (empty($records)) {
*/
echo '
<div class="nav-tabs-custom">
<ul class="nav nav-tabs pull-right" role="tablist">
<ul class="nav nav-tabs pull-right" id="tabs" role="tablist">
<li class="pull-left active header">';
// Verifico se ho impostato un nome modulo personalizzato
@ -74,6 +74,7 @@ if (file_exists($docroot.'/modules/'.$module_dir.'/add.php') && $module['permess
</li>';
$plugins = $dbo->fetchArray('SELECT id, title FROM zz_plugins WHERE idmodule_to='.prepare($id_module)." AND position='tab' AND enabled = 1");
foreach ($plugins as $plugin) {
echo '
<li>
@ -148,7 +149,6 @@ if ($module['permessi'] == 'r') {
$('a.btn-info, button.btn-info, input[type=button].btn-info', 'section.content').show();
});
<?php
} ?>
var content_was_modified = false;
@ -196,7 +196,6 @@ if ($advanced_sessions) {
setInterval(getActiveUsers, <?php echo get_var('Timeout notifica di presenza (minuti)') * 1000; ?>);
<?php
}
?>
</script>

View File

@ -193,12 +193,12 @@ $(document).ready(function () {
}
// Tabs
$('#tabs').tabs();
$('.nav-tabs').tabs();
// Entra nel tab indicato al caricamento della pagina
var hash = window.location.hash ? window.location.hash : getUrlVars().hash;
if (hash && hash != '#tab_0') {
$('ul.nav a[href="' + hash + '"]').tab('show');
$('ul.nav-tabs a[href="' + hash + '"]').tab('show');
}
// Nel caso la navigazione sia da mobile, disabilito il ritorno al punto precedente

View File

@ -13,15 +13,14 @@ if (!empty($google)) {
}
if (!$cliente) {
$plugins = $dbo->fetchArray("SELECT id FROM zz_plugins WHERE name='Impianti del cliente' OR name='Ddt del cliente'");
$ignore = $dbo->fetchArray("SELECT id FROM zz_plugins WHERE name='Impianti del cliente' OR name='Ddt del cliente'");
foreach ($plugins as $plugin) {
foreach ($ignore as $plugin) {
echo '
<script>
$("#link-tab_'.$plugin['id'].'").addClass("disabled");
</script>';
}
}
?><form action="" method="post" role="form">
@ -411,15 +410,15 @@ if (!str_contains($records[0]['idtipianagrafica'], $id_azienda)) {
<script>
$(document).ready( function(){
$('.colorpicker').colorpicker().on('changeColor', function(){
$('#colore').parent().find('.square').css('background', $('#colore').val());
$(".colorpicker").colorpicker().on("changeColor", function(){
$("#colore").parent().find(".square").css("background", $("#colore").val());
});
$('#colore').parent().find('.square').css('background', $('#colore').val());
$("#colore").parent().find(".square").css("background", $("#colore").val());
$("#geocomplete input").geocomplete({
map: $('#map').length ? "#map" : false,
location: $('#gaddress').val() ? $('#gaddress').val() : [$('#lat').val(), $('#lng').val()],
map: $("#map").length ? "#map" : false,
location: $("#gaddress").val() ? $("#gaddress").val() : [$("#lat").val(), $("#lng").val()],
details: ".details",
detailsAttribute: "data-geo"
}).bind("geocode:result", function (event, result) {