Skip to content
Snippets Groups Projects
Commit 22927b0b authored by Ide Braakman's avatar Ide Braakman Committed by Devin Zuczek
Browse files

Issue #2399895 by idebr: Multichoice.js is incompatible with jQuery 1.9+

parent 63e50f98
No related branches found
No related tags found
No related merge requests found
......@@ -97,10 +97,18 @@ var Multichoice = Multichoice || {};
.click(function (event) {
$(this).toggleClass('selected');
if (event.target.type !== 'checkbox') {
$(':checkbox', this).attr('checked', function () {
return !this.checked;
});
$(':radio', this).attr('checked', true);
if (typeof $.fn.prop === 'function') {
$(':checkbox', this).prop('checked', function (i, val) {
return !val;
});
$(':radio', this).prop('checked', 'checked');
}
else {
$(':checkbox', this).attr('checked', function () {
return !this.checked;
});
$(':radio', this).attr('checked', true);
}
if ($(':radio', this).html() != null) {
$(this).parent().find('.multichoice-row').removeClass('selected');
$(this).addClass('selected');
......@@ -110,4 +118,4 @@ var Multichoice = Multichoice || {};
}
};
})(jQuery);
\ No newline at end of file
})(jQuery);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment