CRM-14480 - crmCaseType - New options should appear in dropdowns
authorTim Otten <totten@civicrm.org>
Mon, 2 Jun 2014 23:11:20 +0000 (16:11 -0700)
committerTim Otten <totten@civicrm.org>
Mon, 2 Jun 2014 23:12:13 +0000 (16:12 -0700)
js/angular-crmCaseType.js

index 617f6726c7d2aaa74d83199a28f92d41a800dfaa..e473574a0e9f90986d5ca2e6086d19f54fc2524c 100644 (file)
           scope.$evalAsync('_resetSelection()');
           e.preventDefault();
         });
+
+        scope.$watch(attrs.crmOptions, function(value) {
+          $(input).select2('data', getFormattedOptions);
+          $(input).select2('val', '');
+        });
       }
     };
   });
       activitySet.activityTypes.push({
         name: activityType
       });
+      if (!_.contains($scope.activityTypeNames, activityType)) {
+        $scope.activityTypeNames.push(activityType);
+      }
     };
 
     /// Add a new top-level activity-type entry
         $scope.caseType.definition.activityTypes.push({
           name: activityType
         });
+
+      }
+      if (!_.contains($scope.activityTypeNames, activityType)) {
+        $scope.activityTypeNames.push(activityType);
       }
     };
 
           name: roleName
         });
       }
+      if (!_.contains($scope.relationshipTypeNames, roleName)) {
+        $scope.relationshipTypeNames.push(roleName);
+      }
     };
 
     $scope.onManagerChange = function(managerRole) {