Click on the points in the map panel to open a popup. See that the popup will be positioned automatically top or below and right and left of its location. The js is not minified so it is readable. See popup-auto-position.js.