From 438f2b52e2ac6b9df3c3a74dae22f0485845d2c2 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Mon, 30 Jun 2014 21:08:44 -0700 Subject: [PATCH] CRM-14798 - crmCaseType - Fix handling of labels+validation In our UX, labels are supposed to turn red when a field becomes invalid, and they're supposed to include a red "*" if required. This adds an Angular directive to enforce both. --- css/civicrm.css | 4 +- js/angular-crm-ui.js | 63 +++++++++++++++++++++++ partials/crmCaseType/caseTypeDetails.html | 46 ++++++++++++++--- 3 files changed, 103 insertions(+), 10 deletions(-) diff --git a/css/civicrm.css b/css/civicrm.css index 6ad2f09dcc..d56789b8ce 100644 --- a/css/civicrm.css +++ b/css/civicrm.css @@ -4715,9 +4715,9 @@ span.crm-status-icon { text-decoration: line-through; } -.crm-container .ng-invalid { +.crm-container .ng-invalid.ng-dirty { border: 1px solid red; } -.crm-container .ng-valid { +.crm-container .ng-valid, .crm-container .ng-pristine { border: 1px solid #666; } diff --git a/js/angular-crm-ui.js b/js/angular-crm-ui.js index 52c02a2739..db82722007 100644 --- a/js/angular-crm-ui.js +++ b/js/angular-crm-ui.js @@ -1,7 +1,70 @@ /// crmUi: Sundry UI helpers (function (angular, $, _) { + var idCount = 0; angular.module('crmUi', []) + // example:
...