Commit d0ddd91f authored by Dries's avatar Dries

- Patch #535966 by jablko, casey: add ':target' to selector for removing 'collapsed' class.

parent b4634929
...@@ -58,8 +58,9 @@ Drupal.behaviors.collapse = { ...@@ -58,8 +58,9 @@ Drupal.behaviors.collapse = {
attach: function (context, settings) { attach: function (context, settings) {
$('fieldset.collapsible', context).once('collapse', function () { $('fieldset.collapsible', context).once('collapse', function () {
var $fieldset = $(this); var $fieldset = $(this);
// Expand if there are errors inside. // Expand fieldset if there are errors inside, or if it contains an
if ($('.error', $fieldset).length) { // element that is targeted by the uri fragment identifier.
if ($('.error, :target', $fieldset).length) {
$fieldset.removeClass('collapsed'); $fieldset.removeClass('collapsed');
} }
......
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