vakata/jstree — pull request #785 by janslow (2014-08-01 10:57:05+00:00)
Title: Clone array of selected nodes in get_selected method

Currently, get_selected(true) is called, a new array is returned (so the user is free to edit it), however get_selected(false) returns the same array which is used internally.

Therefore the internal array can be directly edited, causing issues such as not being able to reselect nodes.

This commit just slices the the array before returning it, so a clone of the array is returned.