Fixes bug 21697: When a date filter is removed, it is applied when tabbing out
authorAugusto Mauch <augusto.mauch@openbravo.com>
Fri, 28 Sep 2012 11:24:29 +0200
changeset 18070 803d0686dbd3
parent 18069 fe3bcfb01f48
child 18071 8d6028e7aba3
Fixes bug 21697: When a date filter is removed, it is applied when tabbing out

Before this fix, in order to delete a date filter the Enter key had to be pressed. This was not consistent, because in order to apply a not-null date filter, it was enough to tab out of the column. Now, if the date filter text is deleted and the column loses the focus, the change will be applied even if the Enter key is not pressed.
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-minidaterange.js
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-minidaterange.js	Fri Sep 28 10:52:06 2012 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-minidaterange.js	Fri Sep 28 11:24:29 2012 +0200
@@ -278,6 +278,12 @@
       return;
     }
 
+    // Apply the empty filter if the date text has been deleted
+    // See issue https://issues.openbravo.com/view.php?id=21697
+    if (newValue === '') {
+      return true;
+    }
+
     if (newValue === oldValue) {
       return false;
     }