From 280ae160085c0a1839dbf943fb416a8fd347df76 Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Tue, 26 Aug 2014 13:41:48 +0000 Subject: [PATCH] Backport commit r48254, committed by Nathan Gray. Always include date sub-template, and just disable it when not needed. Fixes date widgets not validated. --- infolog/js/app.js | 15 +++++++++++++-- infolog/templates/default/index.xet | 2 +- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/infolog/js/app.js b/infolog/js/app.js index 8a82642c70..db1a0ecb15 100644 --- a/infolog/js/app.js +++ b/infolog/js/app.js @@ -115,22 +115,33 @@ app.classes.infolog = AppJS.extend( }, /** + * Enable or disable the date filter * + * If the filter is set to something that needs dates, we enable the + * header_left template. Otherwise, it is disabled. */ filter_change: function() { var filter = this.et2.getWidgetById('filter'); var nm = this.et2.getWidgetById('nm'); + var dates = this.et2.getWidgetById('infolog.index.dates'); if(nm && filter) { switch(filter.getValue()) { case 'bydate': case 'duedate': - nm.set_header_left('infolog.index.dates'); + + if (filter && dates) + { + dates.set_disabled(false); + } break; default: - nm.set_header_left(); + if (dates) + { + dates.set_disabled(true); + } break; } } diff --git a/infolog/templates/default/index.xet b/infolog/templates/default/index.xet index 7c8175fb66..4f848e91b0 100644 --- a/infolog/templates/default/index.xet +++ b/infolog/templates/default/index.xet @@ -163,7 +163,7 @@