From cad736d74beed26073db42c90f8c016213c9748b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Tempez?= Date: Wed, 27 Apr 2022 16:08:39 +0200 Subject: [PATCH] =?UTF-8?q?Edition=20d'une=20fonte=20buf=20affichage=20des?= =?UTF-8?q?=20options=20des=20s=C3=A9lecteurs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../theme/view/fontEdit/fontEdit.js.php | 49 +++++++++++-------- core/module/theme/view/fontEdit/fontEdit.php | 4 +- 2 files changed, 31 insertions(+), 22 deletions(-) diff --git a/core/module/theme/view/fontEdit/fontEdit.js.php b/core/module/theme/view/fontEdit/fontEdit.js.php index d702e658..7402f624 100644 --- a/core/module/theme/view/fontEdit/fontEdit.js.php +++ b/core/module/theme/view/fontEdit/fontEdit.js.php @@ -14,31 +14,40 @@ * Option par défaut du sélecteur de mode */ $(document).ready(function(){ - $('input[name=fontEditFontImported]').prop('checked', true); - $('input[name=fontEditFontUrl]').prop('checked', false); - $('#containerfontEditFile').hide(); + if( $('input[name=fontEditFontImported]').is(':checked') ){ + $('#containerfontEditFile').hide(); + $('#containerfontEditUrl').show(); + } + + + if( $('input[name=fontEditFontFile]').is(':checked') ){ + $('#containerfontEditFile').show(); + $('#containerfontEditUrl').hide(); + } + }); /** * Mode téléchargement en ligne de la fonte ou installation locale */ -$("input[name=fontEditFontImported]").on("click", function() { - if( $('input[name=fontEditFontImported]').is(':checked') ){ - $('input[name=fontEditFontFile]').prop('checked', false); - } else { - $('input[name=fontEditFontFile]').prop('checked', true); - } - $('#containerfontEditFile').hide(); - $('#containerfontEditUrl').show(); -}); + $("input, select").on("change", function() { + + if( $('input[name=fontEditFontImported]').is(':checked') ){ + $('input[name=fontEditFontFile]').prop('checked', false); + $('#containerfontEditFile').hide(); + $('#containerfontEditUrl').show(); + } else { + $('input[name=fontEditFontFile]').prop('checked', true); + } + + + if( $('input[name=fontEditFontFile]').is(':checked') ){ + $('input[name=fontEditFontImported]').prop('checked', false); + $('#containerfontEditFile').show(); + $('#containerfontEditUrl').hide(); + } else { + $('input[name=fontEditFontImported]').prop('checked', true); + } -$("input[name=fontEditFontFile]").on("click", function() { - if( $('input[name=fontEditFontFile]').is(':checked') ){ - $('input[name=fontEditFontImported]').prop('checked', false); - } else { - $('input[name=fontEditFontImported]').prop('checked', true); - } - $('#containerfontEditFile').show(); - $('#containerfontEditUrl').hide(); }); diff --git a/core/module/theme/view/fontEdit/fontEdit.php b/core/module/theme/view/fontEdit/fontEdit.php index 15b7a535..30cb46c8 100644 --- a/core/module/theme/view/fontEdit/fontEdit.php +++ b/core/module/theme/view/fontEdit/fontEdit.php @@ -34,7 +34,7 @@
$this->getUrl(2) === 'file' ? true : false + 'checked' => $this->getUrl(2) === 'files' ? true : false ]); ?>
@@ -67,7 +67,7 @@
'Fichier de fonte (Format WOFF)', - 'value' => $this->getUrl(2) === 'file' ? $this->getData(['fonts', $this->getUrl(2), $this->getUrl(3), 'resource']) : '' + 'value' => $this->getUrl(2) === 'files' ? $this->getData(['fonts', $this->getUrl(2), $this->getUrl(3), 'resource']) : '' ]); ?>