Commit 7eb94f88 authored by webchick's avatar webchick

Issue #1428538 by Albert Volkman, nod_: Use jQuery toggle.

parent d892dc24
......@@ -360,7 +360,7 @@ states.State.prototype = {
$(e.target)
.attr('disabled', e.value)
.filter('.form-element')
.closest('.form-item, .form-submit, .form-wrapper')[e.value ? 'addClass' : 'removeClass']('form-disabled');
.closest('.form-item, .form-submit, .form-wrapper').toggleClass('form-disabled', e.value);
// Note: WebKit nightlies don't reflect that change correctly.
// See https://bugs.webkit.org/show_bug.cgi?id=23789
......@@ -380,7 +380,7 @@ states.State.prototype = {
$(document).bind('state:visible', function(e) {
if (e.trigger) {
$(e.target).closest('.form-item, .form-submit, .form-wrapper')[e.value ? 'show' : 'hide']();
$(e.target).closest('.form-item, .form-submit, .form-wrapper').toggle(e.value);
}
});
......
......@@ -70,7 +70,7 @@ Drupal.tableSelectRange = function (from, to, state) {
}
// Either add or remove the selected class based on the state of the target checkbox.
$(i)[ state ? 'addClass' : 'removeClass' ]('selected');
$(i).toggleClass('selected', state);
$('input:checkbox', i).each(function () {
this.checked = state;
});
......
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