Lesi,
The best place is in the jimu/PopupManager.js file (lines 24 -38):
_createPopupMenuButton: function(){
if(this.popupMenuButtonDesktop) {
html.destroy(this.popupMenuButtonDesktop);
}
if(this.popupMenuButtonMobile) {
html.destroy(this.popupMenuButtonMobile);
}
this.popupMenuButtonDesktop = html.create('span', {
'class': 'popup-menu-button'
}, query(".actionList", this.popupUnion.bigScreen.domNode)[0]);
var mobileActionListNode =
query("div.esriMobileInfoView.esriMobilePopupInfoView .esriMobileInfoViewItem").parent()[0];
var mobileViewItem = html.create('div', {
'class': 'esriMobileInfoViewItem'
}, mobileActionListNode);
this.popupMenuButtonMobile = html.create('span', {
'class': 'popup-menu-button'
}, mobileViewItem);
on(this.popupMenuButtonMobile, 'click', lang.hitch(this, this._onPopupMenuButtonClick));
on(this.popupMenuButtonDesktop, 'click', lang.hitch(this, this._onPopupMenuButtonClick));
var link = html.create("a",{
"class": "action",
"id": "statsLink",
"innerHTML": "Population",
"href": "javascript: void(0);"
}, query(".actionList", this.popupUnion.bigScreen.domNode)[0]);
on(link, "click", this.calculatePopulation);
},
calculatePopulation: function(){
},
Be advised that you will have to do more coding to handle mobile popups though.