From 741b3bfbbebd8a56350795ce748ba76eb92be395 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Fri, 2 Jan 2015 13:46:57 -0500 Subject: [PATCH] crmEditable code cleanup --- js/jquery/jquery.crmeditable.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/js/jquery/jquery.crmeditable.js b/js/jquery/jquery.crmeditable.js index 201d893054..79f8d74515 100644 --- a/js/jquery/jquery.crmeditable.js +++ b/js/jquery/jquery.crmeditable.js @@ -197,15 +197,14 @@ context: 'create' }; $i.data('optionsHashKey', hash); - if (optionsCache[hash]) { - return formatOptions(optionsCache[hash]); + if (!optionsCache[hash]) { + $.ajax({ + url: CRM.url('civicrm/ajax/rest'), + data: {entity: info.entity, action: 'getoptions', json: JSON.stringify(params)}, + async: false, // jeditable lacks support for async options lookup + success: function(data) {optionsCache[hash] = data.values;} + }); } - $.ajax({ - url: CRM.url('civicrm/ajax/rest'), - data: {entity: info.entity, action: 'getoptions', json: JSON.stringify(params)}, - async: false, // jeditable lacks support for async options lookup - success: function(data) {optionsCache[hash] = data.values;} - }); return formatOptions(optionsCache[hash]); } -- 2.25.1