diff options
author | Dries Buytaert <dries@buytaert.net> | 2009-08-12 11:32:07 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2009-08-12 11:32:07 +0000 |
commit | 3506918ab6b86608e6e3b7919ffc1b21b0d33c86 (patch) | |
tree | 84f7ba13480ae4e0a7a1012fca874c1295e7fc48 /themes | |
parent | 36e082ba9165d6583ccbf64fd5441ddc3986693b (diff) | |
download | brdo-3506918ab6b86608e6e3b7919ffc1b21b0d33c86.tar.gz brdo-3506918ab6b86608e6e3b7919ffc1b21b0d33c86.tar.bz2 |
- Patch #539724 by Gábor Hojtsy, Bohjan: make Seven legends look like on the mocks.
Diffstat (limited to 'themes')
-rw-r--r-- | themes/seven/style.css | 23 | ||||
-rw-r--r-- | themes/seven/template.php | 23 |
2 files changed, 45 insertions, 1 deletions
diff --git a/themes/seven/style.css b/themes/seven/style.css index 12848cf87..07ccb7d4b 100644 --- a/themes/seven/style.css +++ b/themes/seven/style.css @@ -443,14 +443,35 @@ table tr.selected td { /* Fieldsets & Form items */ fieldset { border: 1px solid #ccc; - padding: 9px; + padding: 30px 13px 13px 14px; margin: 0 0 10px; } +fieldset legend span, +fieldset legend a { + position: absolute; + margin-top: 9px; +} + +fieldset legend a span { + position: relative; + margin-top: 0; +} + fieldset.collapsed { background: transparent; } +html.js fieldset.collapsed legend, +html.js fieldset.collapsed legend * { + display: block; +} +html.js fieldset.collapsed { + border-width: 1px; + margin-bottom: 10px; + padding: 13px; +} + fieldset fieldset { background: #fff; } diff --git a/themes/seven/template.php b/themes/seven/template.php index 701b54c2a..9fd97f12f 100644 --- a/themes/seven/template.php +++ b/themes/seven/template.php @@ -65,3 +65,26 @@ function seven_tablesort_indicator($style) { return theme('image', $theme_path . '/images/arrow-desc.png', t('sort icon'), t('sort descending')); } } + +/** + * Override of theme_fieldset(). + * + * Add span to legend tag, so we can style it to be inside the fieldset. + */ +function seven_fieldset($element) { + if (!empty($element['#collapsible'])) { + drupal_add_js('misc/collapse.js'); + + if (!isset($element['#attributes']['class'])) { + $element['#attributes']['class'] = ''; + } + + $element['#attributes']['class'] .= ' collapsible'; + if (!empty($element['#collapsed'])) { + $element['#attributes']['class'] .= ' collapsed'; + } + } + $element['#attributes']['id'] = $element['#id']; + + return '<fieldset' . drupal_attributes($element['#attributes']) . '>' . ($element['#title'] ? '<legend><span>' . $element['#title'] . '</span></legend>' : '') . (isset($element['#description']) && $element['#description'] ? '<div class="fieldset-description">' . $element['#description'] . '</div>' : '') . (!empty($element['#children']) ? $element['#children'] : '') . (isset($element['#value']) ? $element['#value'] : '') . "</fieldset>\n"; +} |