automatic resizing and repositioning sidebar on window resize