summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--misc/collapse.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/misc/collapse.js b/misc/collapse.js
index eaae23fd3..fddc9a61f 100644
--- a/misc/collapse.js
+++ b/misc/collapse.js
@@ -58,8 +58,9 @@ Drupal.behaviors.collapse = {
attach: function (context, settings) {
$('fieldset.collapsible', context).once('collapse', function () {
var $fieldset = $(this);
- // Expand if there are errors inside.
- if ($('.error', $fieldset).length) {
+ // Expand fieldset if there are errors inside, or if it contains an
+ // element that is targeted by the uri fragment identifier.
+ if ($('.error, :target', $fieldset).length) {
$fieldset.removeClass('collapsed');
}