ezraroi/ngJsTree

Pushing multiple nodes in succession at root level hangs the browser

Opened this issue · 6 comments

I have discovered that pushing multiple nodes at root level in succession hangs the browser.
My findings reveal that a while loop is set infinitely in the nodesWatcher.onAdded method.

nodesWatcher.onAdded = function (node) {
                    while(blocked) {}
                    blocked = true;
                    var parent = scope.tree.jstree(true).get_node(node.parent);
                    var res = scope.tree.jstree(true).create_node(parent, node, 'inside',function() {
                        blocked = false;
                    });
                    if (!res) {
                        blocked = false;
                    }
                };

+1

Can you please reproduce this on plunker?

I am sorry - could not find time to reproduce this on plunkr. There were some issues in creating the plunkr initially and then i got busy. I will post a plunkr as soon as i get time. Also, i discovered that if i disable web-worker in the config options - i dont face this issue.

thanks

+1