Skip to content

Commit

Permalink
Merge pull request #4252 from ZitaNemeckova/fix_onfocus_radion_buttons
Browse files Browse the repository at this point in the history
Use onchange as well as onfocus for radio buttons
(cherry picked from commit eff0299)

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1598873
  • Loading branch information
h-kataria authored and simaishi committed Jul 11, 2018
1 parent 0058a4b commit 018c162
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions app/assets/javascripts/miq_ujs_bindings.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,22 @@ $(document).ready(function () {
}
});

// Firefox on MacOs isn't firing onfocus events for radio buttons so onchange is used instead
$(document).on('change', '[data-miq_observe]', function () {
var el = $(this);
var parms = $.parseJSON(el.attr('data-miq_observe'));
var id = el.attr('id');
var value = el.prop('multiple') ? el.val() : encodeURIComponent(el.prop('value'));

miqObserveRequest(parms.url, {
no_encoding: true,
data: id + '=' + value,
beforeSend: !! el.attr('data-miq_sparkle_on'),
complete: !! el.attr('data-miq_sparkle_off'),
done: attemptAutoRefreshTrigger(parms),
});
});

$(document).on('change', '[data-miq_observe_checkbox]', function (event) {
var el = $(this);
var parms = $.parseJSON(el.attr('data-miq_observe_checkbox'));
Expand Down

0 comments on commit 018c162

Please sign in to comment.