From 49e5c704733817bc8f7a8be544b68e3ac1da60c4 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Fri, 2 May 2014 17:06:32 -0700 Subject: [PATCH] CRM-13966 - Remove legacy autocomplete plugin --- CRM/Core/Resources.php | 4 ---- js/Common.js | 6 ------ templates/CRM/common/Navigation.tpl | 6 +++--- 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/CRM/Core/Resources.php b/CRM/Core/Resources.php index 33f1116bb1..01941ba516 100644 --- a/CRM/Core/Resources.php +++ b/CRM/Core/Resources.php @@ -588,10 +588,6 @@ class CRM_Core_Resources { "packages/jquery/plugins/select2/select2.js", // No mini until release of select2 3.4.6 "packages/jquery/plugins/select2/select2.css", - // TODO: Remove before 4.5 release - "packages/jquery/plugins/jquery.autocomplete.js", - "packages/jquery/css/jquery.autocomplete.css", - "packages/jquery/plugins/jquery.tableHeader.js", "packages/jquery/plugins/jquery.textarearesizer.js", diff --git a/js/Common.js b/js/Common.js index 2818abc18c..ec578980b1 100644 --- a/js/Common.js +++ b/js/Common.js @@ -850,12 +850,6 @@ CRM.validate = CRM.validate || { catch (e) {} }); - /** - * Temporary stub to get around name conflict with legacy jQuery.autocomplete plugin - * FIXME: Remove this before 4.5 release - */ - $.widget('civi.crmAutocomplete', $.ui.autocomplete, {}); - $(function () { // Trigger crmLoad on initial content for consistency. It will also be triggered for ajax-loaded content. $('.crm-container').trigger('crmLoad'); diff --git a/templates/CRM/common/Navigation.tpl b/templates/CRM/common/Navigation.tpl index dcd8dd3961..094d9acfb4 100644 --- a/templates/CRM/common/Navigation.tpl +++ b/templates/CRM/common/Navigation.tpl @@ -89,7 +89,7 @@ $('#civicrm-menu').ready(function() { }); $('#sort_name_navigation') - .crmAutocomplete({ + .autocomplete({ source: function(request, response) { var option = $('input[name=quickSearchField]:checked'), @@ -117,7 +117,7 @@ $('#civicrm-menu').ready(function() { }, create: function() { // Place menu in front - $(this).crmAutocomplete('widget').css('z-index', $('#civicrm-menu').css('z-index')); + $(this).autocomplete('widget').css('z-index', $('#civicrm-menu').css('z-index')); } }) .keydown(function() { @@ -147,7 +147,7 @@ $('#civicrm-menu').ready(function() { }); // redirect to view page if there is only one contact $('#id_search_block').on('submit', function() { - var $menu = $('#sort_name_navigation').crmAutocomplete('widget'); + var $menu = $('#sort_name_navigation').autocomplete('widget'); if ($('li.ui-menu-item', $menu).length === 1) { var cid = $('li.ui-menu-item', $menu).data('ui-autocomplete-item').value; document.location = CRM.url('civicrm/contact/view', {reset: 1, cid: cid}); -- 2.25.1