Skip to content
This repository was archived by the owner on Jun 19, 2024. It is now read-only.

Commit 4cb3b88

Browse files
author
clivezhg
authored
Merge pull request #4 from clivezhg/cli_work
Version 1.0.0 (a bit optimization)
2 parents ec7b12a + b814e3f commit 4cb3b88

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/select2totree.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
container.setAttribute("data-pup", ele.getAttribute("data-pup"));
2121
}
2222
if ($(container).hasClass("non-leaf")) {
23-
return $('<span class="expand-collapse" onmouseup="expColMouseupHandler(event);"></span>' + $("<div></div").append($iteme).html());
23+
return $.merge($('<span class="expand-collapse" onmouseup="expColMouseupHandler(event);"></span>'), $iteme);
2424
}
2525
}
2626
return $iteme;
@@ -103,7 +103,7 @@
103103
if (pup) {
104104
var pupEle = $options.find(".select2-results__option[data-val='" + pup + "']");
105105
if (pupEle.length > 0) {
106-
if (!pupEle.eq(0).hasClass("opened")) {
106+
if (!pupEle.eq(0).hasClass("opened")) { // hide current node if any parent node is collapsed
107107
$(ele).removeClass("showme");
108108
shouldShow = false;
109109
break;

0 commit comments

Comments
 (0)