dropdown js: switch position if it doesn't fit the configured way
dropdown js: switch position if it doesn't fit the configured way

This updates the dropdown max height detect logic to automatically
switch the position if the dropdown won't fit in the configured
position.  If it fits in poth positions, it prefers the configured
way.  If it fits in neither position, it prefers the way with the
most available height.

redding/romo,redding/romo,redding/romo