summaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
Diffstat (limited to 'misc')
-rw-r--r--misc/collapse.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/misc/collapse.js b/misc/collapse.js
index fddc9a61f..28b3090ee 100644
--- a/misc/collapse.js
+++ b/misc/collapse.js
@@ -60,7 +60,8 @@ Drupal.behaviors.collapse = {
var $fieldset = $(this);
// 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) {
+ var anchor = location.hash && location.hash != '#' ? ', ' + location.hash : '';
+ if ($('.error' + anchor, $fieldset).length) {
$fieldset.removeClass('collapsed');
}