Commit 270a3748 authored by webchick's avatar webchick

#984416 by Berdir: Fixed #states doesn't work on submit buttons

parent 363256d0
......@@ -354,7 +354,7 @@ states.State.prototype = {
$(e.target)
.attr('disabled', e.value)
.filter('.form-element')
.closest('.form-item, .form-wrapper')[e.value ? 'addClass' : 'removeClass']('form-disabled');
.closest('.form-item, .form-submit, .form-wrapper')[e.value ? 'addClass' : 'removeClass']('form-disabled');
// Note: WebKit nightlies don't reflect that change correctly.
// See https://bugs.webkit.org/show_bug.cgi?id=23789
......@@ -363,13 +363,13 @@ states.State.prototype = {
$(document).bind('state:required', function(e) {
if (e.trigger) {
$(e.target).closest('.form-item, .form-wrapper')[e.value ? 'addClass' : 'removeClass']('form-required');
$(e.target).closest('.form-item, .form-submit, .form-wrapper')[e.value ? 'addClass' : 'removeClass']('form-required');
}
});
$(document).bind('state:visible', function(e) {
if (e.trigger) {
$(e.target).closest('.form-item, .form-wrapper')[e.value ? 'show' : 'hide']();
$(e.target).closest('.form-item, .form-submit, .form-wrapper')[e.value ? 'show' : 'hide']();
}
});
......
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