Changing checkbox/radion display toggle to use click event

- change event wasn't fired in IE when the page didn't first have focus. click seems to overlap with change in other change scenarios (label click, tab focus + space select) so we're all good

--HG--
branch : dev
This commit is contained in:
Nathan Heskew
2010-03-07 02:50:35 -08:00
parent ef5f7edca7
commit f8b0317b8c

View File

@@ -16,15 +16,9 @@
$("[data-controllerid=" + controller.attr("id") + "]").hide();
}
if (controller.is(":checkbox")) {
controller.change(function() {
$(this).toggleWhatYouControl();
});
controller.click($(this).toggleWhatYouControl);
} else if (controller.is(":radio")) {
$("[name=" + controller.attr("name") + "]").change(function() {
$("[name=" + $(this).attr("name") + "]").each(function() {
$(this).toggleWhatYouControl();
});
});
$("[name=" + controller.attr("name") + "]").click(function() { $("[name=" + $(this).attr("name") + "]").each($(this).toggleWhatYouControl); });
}
});
})();