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

merge-requests/26/head
Dries Buytaert 2010-05-14 07:25:53 +00:00
parent b463492978
commit d0ddd91f28
1 changed files with 3 additions and 2 deletions

View File

@ -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');
}