optimized sidebar-handling

sidebar will now be hidden, if it is empty
merge
merge