Edition d'une fonte buf affichage des options des sélecteurs

This commit is contained in:
Fred Tempez 2022-04-27 16:08:39 +02:00
parent 8670ee34d6
commit cad736d74b
2 changed files with 31 additions and 22 deletions

View File

@ -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);
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() {
$("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);
}
$('#containerfontEditFile').hide();
$('#containerfontEditUrl').show();
});
$("input[name=fontEditFontFile]").on("click", function() {
if( $('input[name=fontEditFontFile]').is(':checked') ){
$('input[name=fontEditFontImported]').prop('checked', false);
$('#containerfontEditFile').show();
$('#containerfontEditUrl').hide();
} else {
$('input[name=fontEditFontImported]').prop('checked', true);
}
$('#containerfontEditFile').show();
$('#containerfontEditUrl').hide();
});

View File

@ -34,7 +34,7 @@
</div>
<div class="col6">
<?php echo template::checkbox('fontEditFontFile', true,'Fonte installée', [
'checked' => $this->getUrl(2) === 'file' ? true : false
'checked' => $this->getUrl(2) === 'files' ? true : false
]); ?>
</div>
</div>
@ -67,7 +67,7 @@
<div class="col12">
<?php echo template::file('fontEditFile', [
'label' => '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']) : ''
]); ?>
</div>
</div>