Open GoogleCodeExporter opened 9 years ago
And here is how I fixed this bug:
As far as I understand it, the _repair_state function has the bug.
It is performing the operation to test for parents on all objects at once
instead of testing each one individually.
Here are my code changes that seem to work:
_repair_state : function (obj) {
var t = this;
$(obj).each(function() {
o = t._get_node(this);
if(!o.length) { return; }
var a = o.find("> ul > .jstree-checked").length,
b = o.find("> ul > .jstree-undetermined").length,
c = o.find("> ul > li").length;
if(c === 0) { if(o.hasClass("jstree-undetermined")) { t.check_node(o); } }
else if(a === 0 && b === 0) { t.uncheck_node(o); }
else if(a === c) { t.check_node(o); }
else {
o.parentsUntil(".jstree","li").removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");
}
});
},
Original comment by cysli...@googlemail.com
on 1 Feb 2011 at 3:17
Original issue reported on code.google.com by
cysli...@googlemail.com
on 1 Feb 2011 at 2:21