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;
/**
* @type {number}
*/
#dataset_row_unique_id = 0;
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;
this.#dataset_row_unique_id =
this.#dataset_wrapper.querySelectorAll('.<?= ZBX_STYLE_LIST_ACCORDION_ITEM ?>').length;
jQuery('.overlay-dialogue-body').off('scroll');