civicrm/civicrm-core — pull request #1270 by ravishnair (2013-07-29 10:00:08+00:00)
Title: -- CRM-13037 fix for Navigating among tabs produces wrong popups

----------------------------------------
* CRM-13037:
http://issues.civicrm.org/jira/browse/CRM-13037

The wrong popup was getting generated because all the tabs had "Add new record" button with class as "action-item" and there was a condition in js as follows:
cj('.action-item').each(function () {
cj(this).attr('jshref', cj(this).attr('href'));
cj(this).attr('href', '#browseValues');
});
So, when we navigate from 1 tab to other, suppose from career tab to visa tab, career tab will have both href and jshref as #browseValues as the above condition will be called for all the elements with class "action-item". I restricted it by putting an if condition to check if jshref is already set for the element. If not then run the above condition. Then after fixing this, there was another bug. The lastly ajax loaded form was getting displayed in dialog box of all the tabs. This is because the profile form with a particular Id is not generated in a dialog until we pass reset=1 in its url path. So, I added that and assigned & added onPopupClose(as onPopupClose value is lost after reset=1 is passed) functionality in its url for proper redirection to the tab.