aboutsummaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorElliot Smith <elliot.smith@intel.com>2016-01-15 13:00:57 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-01-15 16:30:00 +0000
commitfcb20f9dfd076f7d35f2a1b7b6767eb4033897c2 (patch)
tree51b8ea99ea6883e2a428b84ae1b8e598a4fc881a /bitbake
parentf9c46f5e5e68229454b28adfe1a793d6b75f3096 (diff)
downloadopenembedded-core-contrib-fcb20f9dfd076f7d35f2a1b7b6767eb4033897c2.tar.gz
bitbake: toastergui: ensure filter_value updates
Clicking on the radio button for a date range filter action populates the from and to fields for that action if they are empty. However, because this doesn't fire "change" events, clicking on the radio button doesn't update the filter_value hidden field. This means that the date range action's filter_value parameter isn't set correctly when the filter popup is submitted. Manually call the changeHandler() to set the filter_value whenever the radio for a date range filter is clicked. [YOCTO #8738] (Bitbake rev: 1a3038cf8d9b32532f1fe92cd3472b4473ffc0c4) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/toaster/toastergui/static/js/table.js32
1 files changed, 18 insertions, 14 deletions
diff --git a/bitbake/lib/toaster/toastergui/static/js/table.js b/bitbake/lib/toaster/toastergui/static/js/table.js
index c154844820..a253917b61 100644
--- a/bitbake/lib/toaster/toastergui/static/js/table.js
+++ b/bitbake/lib/toaster/toastergui/static/js/table.js
@@ -488,20 +488,6 @@ function tableInit(ctx){
action.find('[data-date-to-for]').datepicker(options);
inputTo.val(selectedTo);
- // if the radio button is checked and one or both of the datepickers are
- // empty, populate them with today's date
- radio.change(function () {
- var now = new Date();
-
- if (inputFrom.val() === '') {
- inputFrom.datepicker('setDate', now);
- }
-
- if (inputTo.val() === '') {
- inputTo.datepicker('setDate', now);
- }
- });
-
// set filter_value based on date pickers when
// one of their values changes
var changeHandler = function () {
@@ -529,6 +515,24 @@ function tableInit(ctx){
inputFrom.datepicker('option', 'maxDate', inputTo.val());
});
+ // if the radio button is checked and one or both of the datepickers are
+ // empty, populate them with today's date
+ radio.change(function () {
+ var now = new Date();
+
+ if (inputFrom.val() === '') {
+ inputFrom.datepicker('setDate', now);
+ }
+
+ if (inputTo.val() === '') {
+ inputTo.datepicker('setDate', now);
+ }
+
+ // setting the date like this doesn't fire the changeHandler to
+ // update the filter_value, so do that manually instead
+ changeHandler()
+ });
+
return action;
}