diff --git a/core/modules/simpletest/simpletest.js b/core/modules/simpletest/simpletest.js index c8aa11b..477b162 100644 --- a/core/modules/simpletest/simpletest.js +++ b/core/modules/simpletest/simpletest.js @@ -14,16 +14,10 @@ .html(drupalSettings.simpleTest.images[0]) .on('click', function () { var $tests = $group.nextUntil('.simpletest-group'); - if ($group.hasClass('expanded')) { - $group.removeClass('expanded'); - $tests.addClass('js-hide'); - $image.html(drupalSettings.simpleTest.images[0]); - } - else { - $group.addClass('expanded'); - $tests.removeClass('js-hide'); - $image.html(drupalSettings.simpleTest.images[1]); - } + var expand = !$group.hasClass('expanded'); + $group.toggleClass('expanded', expand); + $tests.toggleClass('js-hide', !expand); + $image.html(drupalSettings.simpleTest.images[+expand]); }); }); }