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']) : '' ]); ?>