Added closeOnResize and closeOnScroll flags (fixes tablets)

Makes it possible to disable closing of the dropdown when resizing or
scrolling.

Resize/scroll are triggered by the soft keyboard on iPad and Android
mobile devices so these flags could be set to false to prevent the
dropdown to close too early. (#669, #719)