Added optional viewport for dynamicPositioning

In my current project, I needed to constrain the dropdown list to the dimensions of a viewport other than the window, so I made it configurable.  If the option is not present, the window will be used for the viewport, so this change is fully backwards-compatible.