function refreshTitle() {
var contactName = $('.crm-summary-display_name').text();
contactName = $.trim(contactName);
- var title = $('title').html().replace(oldName, contactName);
- document.title = title;
+ document.title = $('title').html().replace(oldName, contactName);
oldName = contactName;
}
$('#contactname-block').load(refreshTitle);
$('.crm-inline-edit.form :submit[name$=cancel]').click();
}
});
- // Switch tabs when clicking log link
- $('#crm-container').on('click', '#crm-record-log a.crm-log-view', function() {
- $('#tab_log a').click();
- return false;
- });
- // Handle action links in popup
- $('#crm-container').on('click', '.crm-contact_actions-list a, .crm-contact_activities-list a', function() {
- var tabName = $(this).data('tab') || 'activity';
- var $tab = $('#tab_' + tabName);
- var $panel = $('#' + $tab.attr('aria-controls'));
- CRM.loadForm($(this).attr('href'))
- .on('crmFormSuccess', function() {
- if ($panel.data('civiCrmSnippet')) {
- $panel.crmSnippet('refresh');
- }
- $('#mainTabContainer').tabs('option', 'active', $tab.prevAll().length);
- });
- return false;
- });
+ $('#crm-container')
+ // Switch tabs when clicking log link
+ .on('click', '#crm-record-log a.crm-log-view', function() {
+ $('#tab_log a').click();
+ return false;
+ })
+ // Handle action links in popup
+ .on('click', '.crm-contact_actions-list a, .crm-contact_activities-list a', function() {
+ var tabName = $(this).data('tab') || 'activity';
+ var $tab = $('#tab_' + tabName);
+ var $panel = $('#' + $tab.attr('aria-controls'));
+ CRM.loadForm($(this).attr('href'))
+ .on('crmFormSuccess', function() {
+ if ($panel.data('civiCrmSnippet')) {
+ $panel.crmSnippet('refresh');
+ }
+ $('#mainTabContainer').tabs('option', 'active', $tab.prevAll().length);
+ });
+ return false;
+ });
// Actions menu
$(document).on('click', function(e) {
if ($(e.target).is('#crm-contact-actions-link, #crm-contact-actions-link *')) {