Time selector adjustment

This commit is contained in:
fbsanchez 2020-05-26 11:26:49 +02:00
parent e3803ac934
commit e8a3cb698d
3 changed files with 13 additions and 14 deletions

View File

@ -1088,8 +1088,8 @@ function html_print_extended_select_for_time(
} }
ob_start(); ob_start();
// Use the no_meta parameter because this image is only in the base console // Use the no_meta parameter because this image is only in the base console.
echo '<div id="'.$uniq_name.'_default" style="width:100%;display:flex;align-items: baseline;">'; echo '<div id="'.$uniq_name.'_default" style="width:100%;display:inline">';
html_print_select( html_print_select(
$fields, $fields,
$uniq_name.'_select', $uniq_name.'_select',
@ -1104,7 +1104,7 @@ function html_print_extended_select_for_time(
$readonly, $readonly,
'font-size: xx-small;'.$select_style 'font-size: xx-small;'.$select_style
); );
// The advanced control is only for admins // The advanced control is only for admins.
if ($admin) { if ($admin) {
echo ' <a href="javascript:">'.html_print_image( echo ' <a href="javascript:">'.html_print_image(
'images/pencil.png', 'images/pencil.png',
@ -1123,7 +1123,7 @@ function html_print_extended_select_for_time(
echo '</div>'; echo '</div>';
echo '<div id="'.$uniq_name.'_manual" style="width:100%;display:flex;">'; echo '<div id="'.$uniq_name.'_manual" style="width:100%;display:inline;">';
html_print_input_text($uniq_name.'_text', $selected, '', $size, 255, false, $readonly, false, '', $class); html_print_input_text($uniq_name.'_text', $selected, '', $size, 255, false, $readonly, false, '', $class);
html_print_input_hidden($name, $selected, false, $uniq_name); html_print_input_hidden($name, $selected, false, $uniq_name);
@ -1154,15 +1154,15 @@ function html_print_extended_select_for_time(
echo '</div>'; echo '</div>';
echo "<script type='text/javascript'> echo "<script type='text/javascript'>
$(document).ready (function () { $(document).ready (function () {
period_select_init('$uniq_name', $allow_zero); period_select_init('".$uniq_name."', ".(($allow_zero) ? 'true' : 'null').");
period_select_events('$uniq_name'); period_select_events('".$uniq_name."');
}); });
function period_select_".$name."_update(seconds) { function period_select_".$name."_update(seconds) {
$('#text-".$uniq_name."_text').val(seconds); $('#text-".$uniq_name."_text').val(seconds);
adjustTextUnits('".$uniq_name."'); adjustTextUnits('".$uniq_name."');
calculateSeconds('".$uniq_name."'); calculateSeconds('".$uniq_name."');
$('#".$uniq_name."_manual').css('display', 'flex'); $('#".$uniq_name."_manual').show();
$('#".$uniq_name."_default').css('display', 'none'); $('#".$uniq_name."_default').hide();
} }
</script>"; </script>";
$returnString = ob_get_clean(); $returnString = ob_get_clean();

View File

@ -838,7 +838,7 @@ function post_process_select_events(name) {
function period_select_init(name, allow_zero) { function period_select_init(name, allow_zero) {
// Manual mode is hidden by default // Manual mode is hidden by default
$("#" + name + "_manual").css("display", "none"); $("#" + name + "_manual").css("display", "none");
$("#" + name + "_default").css("display", "flex"); $("#" + name + "_default").css("display", "inline");
// If the text input is empty, we put on it 5 minutes by default // If the text input is empty, we put on it 5 minutes by default
if ($("#text-" + name + "_text").val() == "") { if ($("#text-" + name + "_text").val() == "") {
@ -852,7 +852,7 @@ function period_select_init(name, allow_zero) {
} }
} else if ($("#text-" + name + "_text").val() == 0 && allow_zero != true) { } else if ($("#text-" + name + "_text").val() == 0 && allow_zero != true) {
$("#" + name + "_units option:last").prop("selected", false); $("#" + name + "_units option:last").prop("selected", false);
$("#" + name + "_manual").css("display", "flex"); $("#" + name + "_manual").css("display", "inline");
$("#" + name + "_default").css("display", "none"); $("#" + name + "_default").css("display", "none");
} }
} }
@ -941,13 +941,13 @@ function selectFirst(name) {
*/ */
function toggleBoth(name) { function toggleBoth(name) {
if ($("#" + name + "_default").css("display") == "none") { if ($("#" + name + "_default").css("display") == "none") {
$("#" + name + "_default").css("display", "flex"); $("#" + name + "_default").css("display", "inline");
} else { } else {
$("#" + name + "_default").css("display", "none"); $("#" + name + "_default").css("display", "none");
} }
if ($("#" + name + "_manual").css("display") == "none") { if ($("#" + name + "_manual").css("display") == "none") {
$("#" + name + "_manual").css("display", "flex"); $("#" + name + "_manual").css("display", "inline");
} else { } else {
$("#" + name + "_manual").css("display", "none"); $("#" + name + "_manual").css("display", "none");
} }

View File

@ -70,9 +70,8 @@ ul.wizard li > textarea {
} }
.wizard .discovery_inline_input { .wizard .discovery_inline_input {
display: flex; display: inline;
align-content: end; align-content: end;
flex: 0;
align-self: flex-start; align-self: flex-start;
} }