Fix issues with view button in setup view

This commit is contained in:
Jose Gonzalez 2023-02-15 16:28:40 +01:00
parent fa4d686f4f
commit 8673ea57b1
2 changed files with 9 additions and 5 deletions

View File

@ -1946,9 +1946,9 @@ $(".logo_preview").click (function(e) {
var homeUrl = "<?php echo $config['homeurl']; ?>";
var homeUrlEnt = homeUrl + "<?php echo enterprise_installed() ? 'enterprise/' : ''; ?>";
var elementToCheck = $('#'+e.target.id).parent().attr('id');
// Fill it seing the target has been clicked
switch (e.target.id) {
switch (elementToCheck) {
case 'button-custom_logo_preview':
icon_name = $("select#custom_logo option:selected").val();
icon_path = homeUrlEnt + "images/custom_logo/" + icon_name;
@ -1958,7 +1958,7 @@ $(".logo_preview").click (function(e) {
icon_name = $("select#custom_logo_collapsed option:selected").val();
icon_path = homeUrlEnt + "images/custom_logo/" + icon_name;
options.grayed = true;
break;
break;
case 'button-custom_logo_white_bg_preview':
icon_name = $("select#custom_logo_white_bg option:selected").val();
icon_path = homeUrlEnt + "images/custom_logo/" + icon_name;

View File

@ -3505,8 +3505,12 @@ function html_print_button($label='OK', $name='', $disabled=false, $script='', $
$iconDiv = '';
}
// Defined id. Is usable for span and button.
// TODO. Check if will be proper use button or submit when where appropiate.
$mainId = ((empty($fixedId) === false) ? $fixedId : 'button-'.$name);
if ($imageButton === false) {
$content = '<span style="margin-top: 4px;" class="font_11">'.$label.'</span>';
$content = '<span id="span-'.$mainId.'" style="margin-top: 4px;" class="font_11">'.$label.'</span>';
$content .= $iconDiv;
} else {
$content = $iconDiv;
@ -3526,7 +3530,7 @@ function html_print_button($label='OK', $name='', $disabled=false, $script='', $
$parameters = [];
$parameters[] = 'class="'.$classes.'"';
$parameters[] = (empty($name) === false) ? ' name="'.$name.'"' : '';
$parameters[] = 'id="'.((empty($fixedId) === false) ? $fixedId : 'button-'.$name ).'"';
$parameters[] = 'id="'.$mainId.'"';
$parameters[] = (empty($label) === false) ? ' value="'.$label.'"' : '';
$parameters[] = (empty($script) === false) ? ' onClick="'.$script.'"' : '';
$parameters[] = ($disabled === true) ? ' disabled' : '';