mar10/fancytree — pull request #126 by wolfmanx (2014-01-27 20:25:22+00:00)
Title: allow opts.autoScroll to be saved/restored with deferred expansion

When expanding an entire (sub-)tree, it is not useful to have each expanded node repositioned according to autoScroll. This patch allows to temporarily save/restore the option value:

```js
var optsAutoScroll = opts.autoScroll;
opts.autoScroll = false;
// if expanding, first collapse node without autoScroll
if (expand && optsAutoScroll) {
node.setExpanded(!expand);
}
// visit children without autoScroll
node.visit(function(node){
node.setExpanded(expand);
});
opts.autoScroll = optsAutoScroll;
// if expanding, expand top level and let autoScroll work it's magic
if (expand) {
node.setExpanded(expand);
}
```