Use PrematureExit exception instead of weird hack in tests
[civicrm-core.git] / js / crm.optionEdit.js
index 1b1338ce00a793cca1f54b80241e7305cce9b634..20e01b7afdcbcbb6bb6976af17ab58f00ef5cf2e 100644 (file)
@@ -30,10 +30,13 @@ jQuery(function($) {
    */
   function rebuildOptions($existing, rebuilder) {
     if ($existing.data('api-entity') && $existing.data('api-field')) {
-      CRM.api3($existing.data('api-entity'), 'getoptions', {
+      var params = {
         sequential: 1,
         field: $existing.data('api-field')
-      })
+      };
+      $.extend(params, $existing.data('option-edit-context'));
+
+      CRM.api3($existing.data('api-entity'), 'getoptions', params)
       .done(function(data) {
         rebuilder($existing, data.values);
       });