Sidebar fixes

Fixed sidebar not hiding when clicking outside
Removed $viewContentLoaded event
Cleaned some code