From d0ddd91f28684700e3aa2646f4e76e11c94ad5f5 Mon Sep 17 00:00:00 2001
From: Dries Buytaert <dries@buytaert.net>
Date: Fri, 14 May 2010 07:25:53 +0000
Subject: [PATCH] - Patch #535966 by jablko, casey: add ':target' to selector
 for removing 'collapsed' class.

---
 misc/collapse.js | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/misc/collapse.js b/misc/collapse.js
index eaae23fd3f76..fddc9a61fa67 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');
       }
 
-- 
GitLab