diff -u b/core/misc/collapse.js b/core/misc/collapse.js --- b/core/misc/collapse.js +++ b/core/misc/collapse.js @@ -106,38 +106,29 @@ }, /** - * Toggle the visibility of a details element using smooth animations. + * Toggle the visibility of a details element. */ - toggle: function (isOpen) { - if (typeof isOpen == 'undefined') { - isOpen = !this.$node.attr('open'); - } - - if (!Modernizr.details) { - var $summaryPrefix = this.$node.find('> summary span.details-summary-prefix'); - if (isOpen) { - $summaryPrefix.html(Drupal.t('Hide')); - } - else { - $summaryPrefix.html(Drupal.t('Show')); - } - // Delay setting the attribute to emulate chrome behavior and make - // details-aria.js work as expected with this polyfill. - setTimeout(function () { - this.$node.attr('open', isOpen); - }.bind(this), 0); + toggle: function () { + var isOpen = !!this.$node.attr('open'); + var $summaryPrefix = this.$node.find('> summary span.details-summary-prefix'); + if (isOpen) { + $summaryPrefix.html(Drupal.t('Show')); } else { - this.$node.attr('open', isOpen); + $summaryPrefix.html(Drupal.t('Hide')); } - + // Delay setting the attribute to emulate chrome behavior and make + // details-aria.js work as expected with this polyfill. + setTimeout(function () { + this.$node.attr('open', !isOpen); + }.bind(this), 0); }, /** * Handle invalid event */ invalidHandler: function () { - this.toggle(true); + this.$node.find('> summary').trigger('click'); } });