/** * This file is part of Zwii. * * For full copyright and license information, please see the LICENSE * file that was distributed with this source code. * * @author Rémi Jean * @copyright Copyright (C) 2008-2018, Rémi Jean * @author Frédéric Tempez * @copyright Copyright (C) 2018-2024, Frédéric Tempez * @license CC Attribution-NonCommercial-NoDerivatives 4.0 International * @link http://zwiicms.fr/ */ $(document).ready(function() { // Vérifie si la variable PHP $time est vide ou non var time = 'getData(["module", $this->getUrl(0), "content", $this->getUrl(2), "time"]); ?>'; // Initialisation de l'affichage au chargement de la page if (time === '') { $('#agendaEditAllDay').prop('checked', true); $('#agendaEditTimeWrapper').slideUp(); // Masque immédiatement sans animation } else { $('#agendaEditAllDay').prop('checked', false); $('#agendaEditTimeWrapper').slideDown(); // Affiche immédiatement sans animation } // Ajoute un événement sur le changement de l'état de la checkbox agendaEditAllDay $('#agendaEditAllDay').on('change', function() { if ($(this).is(':checked')) { $('#agendaEditTime').val(''); $('#agendaEditTimeWrapper').slideUp(); // Masque avec un effet de slide } else { $('#agendaEditTimeWrapper').slideDown(); // Affiche avec un effet de slide } }); });