Dont run onsidetoggled if tree view is off

Causes a crash because you can't detach stuff that doesn't exist
Documentation
Merge pull request #284 from Kangaroopower/master

Dont run onsidetoggled if tree view is off. Fixes #272