Source
xxxxxxxxxx
jQuery('> .tree-item > .tree-row > .tools > .js-button-add-child', jQuery(this)).css('visibility', 'visible');
/*
** Zabbix
** Copyright (C) 2001-2022 Zabbix SIA
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** 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 General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**/
const WIDGET_NAVTREE_EVENT_MARK = 'widget-navtree-mark';
const WIDGET_NAVTREE_EVENT_SELECT = 'widget-navtree-select';
class CWidgetNavTree extends CWidget {
_init() {
super._init();
this._severity_levels = null;
this._navtree = [];
this._maps = [];
this._navtree_items_opened = [];
this._navtree_item_selected = null;
this._maps_accessible = null;
this._show_unavailable = false;
this._problems = null;
this._max_depth = 10;
this._last_id = null;
this._has_contents = false;
}
_doActivate() {
super._doActivate();
if (this._has_contents) {
if (this._target.querySelector('.root') === null) {
this._makeTree();
this._activateTree();
}
this._activateContentsEvents();
}
}
_doDeactivate() {
super._doDeactivate();
this._deactivateContentsEvents();
}
announceWidgets(widgets) {
super.announceWidgets(widgets);
this._deactivateContentsEvents();
this._maps = [];
for (const widget of widgets) {
if (widget instanceof CWidgetMap && this._fields.reference === widget._fields.filter_widget_reference) {
this._maps.push(widget);
}
}
if (this._has_contents) {
this._activateContentsEvents();
}
}
getDataCopy({is_single_copy}) {
this._deactivateContentsEvents();
this._setTreeHandlers();
this._updateWidgetFields();
this._activateContentsEvents();
return super.getDataCopy({is_single_copy});
}
setEditMode() {
if (this._has_contents) {
this._deactivateContentsEvents();
this._removeTree();