From 983fc615db634505db7b3af62c633edaaa25a9f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=9F=20=E7=A3=8A?= Date: Mon, 17 Jan 2022 21:03:59 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20API=20addNodes=20=E5=9C=A8=E5=BC=82?= =?UTF-8?q?=E6=AD=A5=E6=97=B6=E8=BF=94=E5=9B=9E=E5=80=BC=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/jquery.ztree.core.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/js/jquery.ztree.core.js b/js/jquery.ztree.core.js index 9226f19..12c634f 100644 --- a/js/jquery.ztree.core.js +++ b/js/jquery.ztree.core.js @@ -1044,7 +1044,7 @@ view.makeUlHtml(setting, node, html, childHtml.join('')); nObj.append(html.join('')); }, - asyncNode: function (setting, node, isSilent, callback) { + asyncNode: function (setting, node, isSilent, callback, isSync) { var i, l; var isParent = data.nodeIsParent(setting, node); if (node && !isParent) { @@ -1085,6 +1085,7 @@ var _tmpV = data.getRoot(setting)._ver; $.ajax({ + async: !isSync, contentType: setting.async.contentType, cache: false, type: setting.async.type, @@ -1342,7 +1343,7 @@ fontStyle.push(f, ":", fontcss[f], ";"); } html.push(" 0) ? " href='" + url + "'" : ""), " target='", view.makeNodeTarget(node), "' style='", fontStyle.join(''), @@ -1806,7 +1807,7 @@ } if (tools.canAsync(setting, parentNode)) { - view.asyncNode(setting, parentNode, isSilent, addCallback); + view.asyncNode(setting, parentNode, isSilent, addCallback, true); } else { addCallback(); } @@ -2016,4 +2017,4 @@ var zt = $.fn.zTree, $$ = tools.$, consts = zt.consts; -})(jQuery); \ No newline at end of file +})(jQuery);