Source
$overlay_body.scrollTop(Math.max($overlay_body.scrollTop(), this.#form.scrollHeight - $overlay_body.height()));
<?php declare(strict_types = 0);
/*
** Copyright (C) 2001-2025 Zabbix SIA
**
** This program is free software: you can redistribute it and/or modify it under the terms of
** the GNU Affero General Public License as published by the Free Software Foundation, version 3.
**
** This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
** without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
** See the GNU Affero General Public License for more details.
**
** You should have received a copy of the GNU Affero General Public License along with this program.
** If not, see <https://www.gnu.org/licenses/>.
**/
use Widgets\PieChart\Includes\{
CWidgetFieldDataSet,
WidgetForm
};
?>
window.widget_pie_chart_form = new class {
/**
* @type {HTMLFormElement}
*/
#form;
/**
* @type {HTMLElement}
*/
#dataset_wrapper;
/**
* @type {Map<HTMLLIElement, CSortable>}
*/
#single_items_sortable = new Map();
/**
* @type {String}
*/
#templateid;
init({form_tabs_id, color_palette, templateid}) {
colorPalette.setThemeColors(color_palette);
this.#form = document.getElementById('widget-dialogue-form');
this.#dataset_wrapper = document.getElementById('data_sets');
this.#templateid = templateid;
jQuery('.overlay-dialogue-body').off('scroll');
for (const colorpicker of this.#form.querySelectorAll('.<?= ZBX_STYLE_COLOR_PICKER ?> input')) {
$(colorpicker).colorpicker({
appendTo: '.overlay-dialogue-body',
use_default: colorpicker.name === 'value_color'
});
}
jQuery(`#${form_tabs_id}`)