[scupgrade] Fixed issue 26041: Date inputs now show 'required' style again
authorDavid Baz Fayos <david.baz@openbravo.com>
Thu, 20 Mar 2014 14:21:32 +0100
changeset 22736 01cb4d10ffc3
parent 22735 bebe124e664d
child 22737 5c090bd9178b
[scupgrade] Fixed issue 26041: Date inputs now show 'required' style again
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities.js
modules/org.openbravo.client.application/web/org.openbravo.userinterface.smartclient/openbravo/skins/Default/org.openbravo.client.application/ob-form-styles.js
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities.js	Thu Mar 20 13:30:01 2014 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities.js	Thu Mar 20 14:21:32 2014 +0100
@@ -224,19 +224,8 @@
 // Adds the Required suffix to a base style for a required formitem, to show it yellow in 
 // the forms.
 OB.Utilities.addRequiredSuffixToBaseStyle = function (item) {
-  if (item && item.required) {
-    // apparently this is called many times therefore do not append
-    // if we already did append it
-    if (item.textFieldProperties && item.textFieldProperties.textBoxStyle) {
-      if (!item.textFieldProperties.textBoxStyle.endsWith('Required')) {
-        // make a copy as the textFieldProperties object is shared by many instances
-        // so you can't change it directly
-        item.textFieldProperties = isc.addProperties({}, item.textFieldProperties);
-        item.textFieldProperties.textBoxStyle = item.textFieldProperties.textBoxStyle + 'Required';
-      }
-    } else if (item.textBoxStyle && !item.textBoxStyle.endsWith('Required')) {
-      item.textBoxStyle = item.textBoxStyle + 'Required';
-    }
+  if (item && item.required && item.textBoxStyle && !item.textBoxStyle.endsWith('Required')) {
+    item.textBoxStyle = item.textBoxStyle + 'Required';
   }
 };
 
--- a/modules/org.openbravo.client.application/web/org.openbravo.userinterface.smartclient/openbravo/skins/Default/org.openbravo.client.application/ob-form-styles.js	Thu Mar 20 13:30:01 2014 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.userinterface.smartclient/openbravo/skins/Default/org.openbravo.client.application/ob-form-styles.js	Thu Mar 20 14:21:32 2014 +0100
@@ -302,16 +302,11 @@
 OB.Styles.OBFormField.DefaultDateInput = {
   cellStyle: 'OBFormField',
   titleStyle: 'OBFormFieldLabel',
-  textBoxStyle: 'OBFormFieldInput',
+  textBoxStyle: 'OBFormFieldDateInput',
   errorOrientation: 'left',
 
   pickerIconHSpace: '0',
 
-  textFieldProperties: {
-    type: 'OBTextField',
-    textBoxStyle: 'OBFormFieldDateInput'
-  },
-
   height: 21,
 
   pickerIconWidth: 21,