From 38558375c162026199e65baa513d7ac314973bb0 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Thu, 29 Oct 2015 20:30:52 -0400 Subject: [PATCH] EntityRef filter UI fixes --- js/Common.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/js/Common.js b/js/Common.js index 136cd3f47a..ed6f9d32d6 100644 --- a/js/Common.js +++ b/js/Common.js @@ -558,11 +558,12 @@ if (!CRM.vars) CRM.vars = {}; // Once a filter has been chosen, rerender create links and refocus the search box $el.select2('close'); $el.select2('open'); + } else { + $('.crm-entityref-links', '#select2-drop').replaceWith(renderEntityRefCreateLinks($el)); } }) .on('change.crmEntity', 'select.crm-entityref-filter-key', function() { - var filter = $el.data('user-filter') || {}; - filter.key = $(this).val(); + var filter = {key: $(this).val()}; $(this).toggleClass('active', !!filter.key); $el.data('user-filter', filter); loadEntityRefFilterOptions($el); @@ -854,7 +855,7 @@ if (!CRM.vars) CRM.vars = {}; }); } } else { - $valField.hide(); + $valField.hide().val('').change(); } } -- 2.25.1