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 * Option par défaut du sélecteur de mode
*/ */
$(document).ready(function(){ $(document).ready(function(){
$('input[name=fontEditFontImported]').prop('checked', true); if( $('input[name=fontEditFontImported]').is(':checked') ){
$('input[name=fontEditFontUrl]').prop('checked', false); $('#containerfontEditFile').hide();
$('#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 * 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); if( $('input[name=fontEditFontImported]').is(':checked') ){
} else { $('input[name=fontEditFontFile]').prop('checked', false);
$('input[name=fontEditFontFile]').prop('checked', true); $('#containerfontEditFile').hide();
} $('#containerfontEditUrl').show();
$('#containerfontEditFile').hide(); } else {
$('#containerfontEditUrl').show(); $('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();
}); });

View File

@ -34,7 +34,7 @@
</div> </div>
<div class="col6"> <div class="col6">
<?php echo template::checkbox('fontEditFontFile', true,'Fonte installée', [ <?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>
</div> </div>
@ -67,7 +67,7 @@
<div class="col12"> <div class="col12">
<?php echo template::file('fontEditFile', [ <?php echo template::file('fontEditFile', [
'label' => 'Fichier de fonte (Format WOFF)', '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>
</div> </div>