Commit 05c90947 authored by Dries's avatar Dries

- Patch #1017882 by Gábor Hojtsy: required elements buggy with #states.

parent 36c4709c
......@@ -362,7 +362,12 @@ states.State.prototype = {
$(document).bind('state:required', function(e) {
if (e.trigger) {
$(e.target).closest('.form-item, .form-submit, .form-wrapper')[e.value ? 'addClass' : 'removeClass']('form-required');
if (e.value) {
$(e.target).closest('.form-item, .form-wrapper').find('label').append('<span class="form-required">*</span>');
}
else {
$(e.target).closest('.form-item, .form-wrapper').find('label .form-required').remove();
}
}
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment