BUGFIX: some sections dont have a tree at all, but they still use LeftAndMain as their base class (eg report admin). Added a guard.

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.4@100724 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Mateusz Uzdowski 2010-03-09 21:16:20 +00:00 committed by Sam Minnee
parent 2128b4cf1e
commit 131c271f9c

View File

@ -23,7 +23,7 @@ var _HANDLER_FORMS = {
// make sure current ID of loaded form is actually selected in tree
var tree = $('#sitetree')[0], id = $('#Form_EditForm :input[name=ID]').val();
if(!id) id = 0;
tree.setCurrentByIdx(id);
if(tree) tree.setCurrentByIdx(id);
}, 200);
});
}(jQuery));