crmCaseType - Fix loading number-ish Javascript data
authorTim Otten <totten@civicrm.org>
Wed, 28 May 2014 04:49:47 +0000 (21:49 -0700)
committerTim Otten <totten@civicrm.org>
Wed, 28 May 2014 04:49:47 +0000 (21:49 -0700)
In Firefox, the initial loading of some fields (like max_instances) failed
because the HTML widget had type "number" but the Javascript data wasn't
strictly numeric (ie it had type "string" with numeric content).

css/angular-crmCaseType.css
partials/crmCaseType/activityTypesTable.html
partials/crmCaseType/timelineTable.html

index 8d6ee1ef3c43a8b7dcf6c5e4a747f65671a2996f..68aeeca8bd61873512249e24e14bf3951ada22cb 100644 (file)
@@ -21,7 +21,7 @@
     text-align: center;
 }
 
-.crmCaseType input[type=number] {
+.crmCaseType input.number {
     width: 3.5em;
 }
 
index 039f02bc11963af12517c56a50bc287c57df7539..1094aaf95eaf0dec2f5544bd5b3ce58efeb5aaf9 100644 (file)
@@ -18,7 +18,7 @@ Required vars: caseType
       {{ activityType.name }}
     </td>
     <td>
-      <input type="number" ng-model="activityType.max_instances" />
+      <input class="number" type="text" ng-pattern="/^[0-9]*$/" ng-model="activityType.max_instances" />
     </td>
     <td>
       <a class="crm-hover-button" ng-click="removeItem(caseType.definition.activityTypes, activityType)">
index 8b8b3187babe942547d4de31618a9826c95d1ba3..9908dc8f88f75c4b1e38556c69e89227d49d65f4 100644 (file)
@@ -32,7 +32,7 @@ Required vars: activitySet
       </select>
     </td>
     <td>
-      <input type="number" ng-model="activity.reference_offset" />
+      <input class="number" type="text" ng-pattern="/^[0-9]*$/" ng-model="activity.reference_offset" />
     </td>
     <td>
       <select ng-model="activity.reference_select" ng-options="key as value for (key,value) in {newest: 'Newest', oldest: 'Oldest'}">