| 1014 | |
| 1015 | |
| 1016 | function 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 | |
| 1033 | function htmlEscape(d) { |
| 1034 | return typeof d === 'string' ? |