I cannot speak to the popup.js file you referenced, but I do use popups via modal windows in my current app and my old app.
For a simple, technical walk-through of creating modal windows, I would recommend this write-up by the Hurricane Labs team. This is the link to part 1 in their 3 part series: https://www.hurricanelabs.com/blog/splunk-custom-modal-view-creation-part-1
If you want to see a somewhat unclean implementation of modal windows that are activated upon drilldown, you can look at my old code in the deprecated app: https://splunkbase.splunk.com/app/1800/. The SimpleXML dashboards show you how to add a modal window containing only text, and the window is triggered when the user clicks on a help icon. The HTML/JS dashboards show you how to do the same thing and how to create a modal window with user inputs that allow for flexible drilldowns to other dashboards.
For a much cleaner implementation in SimpleXML and JS extensions, I would recommend my new app: https://splunkbase.splunk.com/app/3171/. I use a modal window with user inputs and a table. The modal window is activated by a button, and the user can drilldown on data in the modal window's table to populate inputs in the dashboard.
One thing to consider when looking at the different examples is do you want to constantly instantiate a new window or do you want only one modal window object.
The first example from Hurricane Labs creates and destroys the window every time you trigger it.
The last example from my latest app instantiates the modal window a single time for each dashboard. This allows me to keep the user input fields and search results tables between activations without triggering new (unnecessary) searches.