INFRA-132 - js/angular-crmCaseType.js - Cleanup empty checks to satisfy jshint
authorTim Otten <totten@civicrm.org>
Mon, 5 Jan 2015 21:53:32 +0000 (13:53 -0800)
committerTim Otten <totten@civicrm.org>
Mon, 5 Jan 2015 21:53:32 +0000 (13:53 -0800)
js/angular-crmCaseType.js

index 0caf0fa15363aee2d7cfaf87b86412690166784b..dcf752a08f94fb554d384339efcea71cc310e860 100644 (file)
         case 'timeline':
           return true;
         case 'sequence':
-          return 0 == _.where($scope.caseType.definition.activitySets, {sequence: '1'}).length;
+          return 0 === _.where($scope.caseType.definition.activitySets, {sequence: '1'}).length;
         default:
           CRM.console('warn', 'Denied access to unrecognized workflow: (' + workflow + ')');
           return false;
     $scope.save = function() {
       var result = crmApi('CaseType', 'create', $scope.caseType, true);
       result.success(function(data) {
-        if (data.is_error == 0) {
+        if (data.is_error === 0 || data.is_error == '0') {
           $scope.caseType.id = data.id;
           window.location.href = '#/caseType';
         }