Merge pull request #6539 from joannechester/CRM-16185-rename-date-filters
[civicrm-core.git] / js / model / crm.uf.js
index 0cb09999a7e47362001e6649d852f6711753309e..095acddc0dc8e6ed20d9e443f0ac84bb010db05c 100644 (file)
    */
   CRM.UF.UFFieldModel = CRM.Backbone.Model.extend({
     /**
-     * Backbone.Form descripton of the field to which this refers
+     * Backbone.Form description of the field to which this refers
      */
     defaults: {
       help_pre: '',
       },
       'label': {
         title: ts('Field Label'),
-        type: 'Text'
+        type: 'Text',
+        editorAttrs: {maxlength: 255}
       },
       'location_type_id': {
         title: ts('Location Type'),
         title: ts('Profile Name'),
         help: ts(''),
         type: 'Text',
+        editorAttrs: {maxlength: 64},
         validators: ['required']
       },
       'group_type': {
           return _.omit(ufFieldModel.toStrictJSON(), ['id', 'uf_group_id']);
         })
       );
-      copy.set('title', ts('%1 (Copy)', {
-        1: copy.get('title')
-      }));
+      var copyLabel = ' ' + ts('(Copy)');
+      copy.set('title', copy.get('title').slice(0, 64 - copyLabel.length) + copyLabel);
       return copy;
     },
     getModelClass: function(entity_name) {