Source
if ((!isset('width', obj.objDims) || obj.objDims.width < 0) && isset('shiftXleft', obj.objDims) && isset('shiftXright', obj.objDims)) {
/*
** 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/>.
**/
// Time range selector.
jQuery(function($) {
var $container = $('.filter-space').first(),
xhr = null,
endpoint = new Curl('zabbix.php'),
element = {
from: $container.find('[id=from]'),
to: $container.find('[id=to]'),
from_clndr: $container.find('[name=from_calendar]'),
to_clndr: $container.find('[name=to_calendar]'),
apply: $container.find('[name=apply]'),
increment: $container.find('.js-btn-time-right'),
decrement: $container.find('.js-btn-time-left'),
zoomout: $container.find('.btn-time-zoomout'),
quickranges: $container.find('.time-quick a'),
label: $container.find('.btn-time')
},
request_data = {
idx: $container.data('profileIdx'),
idx2: $container.data('profileIdx2'),
from: element.from.val(),
to: element.to.val()
},
prevent_history_updates = $container.data('prevent-history-updates') == 1,
ui_accessible = ($container.data('accessible') == 1),
ui_disabled = false;
endpoint.setArgument('action', 'timeselector.update');
endpoint.setArgument('type', PAGE_TYPE_TEXT_RETURN_JSON);
$.subscribe('timeselector.rangechange timeselector.decrement timeselector.increment timeselector.zoomout' +
' timeselector.rangeoffset',
timeSelectorEventHandler
);
element.from.keydown(submitChangeHandler);
element.to.keydown(submitChangeHandler);
// Time selector DOM elements event triggerers initialization.
$container.on('click', function(event) {
var action = '',
data = {},
$target = $(event.target);
if (ui_disabled) {
return cancelEvent(event);
}
else if ($target.is(element.increment)) {
action = 'timeselector.increment';
}
else if ($target.is(element.decrement)) {
action = 'timeselector.decrement';
}
else if ($target.is(element.zoomout)) {
action = 'timeselector.zoomout';
}
else if ($target.is(element.apply)) {
action = 'timeselector.rangechange';
data = {
from: element.from.val(),
to: element.to.val()
}
}
else if (element.quickranges.index($target) != -1) {
action = 'timeselector.rangechange';
data = $target.data();
element.quickranges.removeClass('selected');
$target.addClass('selected');
}
if (action !== '') {
$.publish(action, data);
}
});
/**