From: Coleman Watts Date: Sun, 5 Jan 2014 05:40:01 +0000 (-0800) Subject: Summary.js - code cleanup X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=db9b1503395601890744dfcb7c8eac1b2dd861e8;p=civicrm-core.git Summary.js - code cleanup --- diff --git a/templates/CRM/Contact/Page/View/Summary.js b/templates/CRM/Contact/Page/View/Summary.js index 7516e68a3e..282825cfe0 100644 --- a/templates/CRM/Contact/Page/View/Summary.js +++ b/templates/CRM/Contact/Page/View/Summary.js @@ -184,8 +184,7 @@ 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); @@ -289,25 +288,26 @@ $('.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 *')) {