Changes the way we calculate the toolbar position, add event to window resize