Fix method to get space above the dropdown

It's better to get the scrollTop value from window rather than body
to update enoughRoomAbove variable. This method is supported by
the main browsers.