MCPcopy
hub / github.com/jumpserver/jumpserver / rootNodeAddDom

Function rootNodeAddDom

apps/static/js/jumpserver.js:1016–1031  ·  view source on GitHub ↗
(ztree, callback)

Source from the content-addressed store, hash-verified

1014
1015
1016function rootNodeAddDom(ztree, callback) {
1017 var refreshIcon = "<a id='tree-refresh'><i class='fa fa-refresh'></i></a>";
1018 var rootNode = ztree.getNodes()[0];
1019 if (rootNode) {
1020 var $rootNodeRef = $("#" + rootNode.tId + "_a");
1021 $rootNodeRef.after(refreshIcon);
1022 } else {
1023 $rootNodeRef = $('#' + ztree.setting.treeId);
1024 $rootNodeRef.html(refreshIcon);
1025 }
1026 var refreshIconRef = $('#tree-refresh');
1027 refreshIconRef.bind('click', function () {
1028 ztree.destroy();
1029 callback()
1030 })
1031}
1032
1033function htmlEscape(d) {
1034 return typeof d === 'string' ?

Callers

nothing calls this directly

Calls 3

bindMethod · 0.80
$Function · 0.70
destroyMethod · 0.45

Tested by

no test coverage detected