Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
796cc0c1
Commit
796cc0c1
authored
Mar 23, 2010
by
Dries Buytaert
Browse files
- Patch
#567224
by mathiaz.sk: vertical tabs appears, even if empty.
parent
c061a16a
Changes
1
Hide whitespace changes
Inline
Side-by-side
misc/vertical-tabs.js
View file @
796cc0c1
...
...
@@ -18,12 +18,19 @@ Drupal.behaviors.verticalTabs = {
$
(
'
.vertical-tabs-panes
'
,
context
).
once
(
'
vertical-tabs
'
,
function
()
{
var
focusID
=
$
(
'
:hidden.vertical-tabs-active-tab
'
,
this
).
val
();
var
focus
;
// Check if there are some fieldsets that can be converted to vertical-tabs
var
$fieldsets
=
$
(
'
> fieldset
'
,
this
);
if
(
$fieldsets
.
length
==
0
)
{
return
;
}
// Create the tab column.
var
list
=
$
(
'
<ul class="vertical-tabs-list"></ul>
'
);
$
(
this
).
wrap
(
'
<div class="vertical-tabs clearfix"></div>
'
).
before
(
list
);
// Transform each fieldset into a tab.
$
(
'
>
fieldset
'
,
this
)
.
each
(
function
()
{
$fieldset
s
.
each
(
function
()
{
var
tab
=
new
Drupal
.
verticalTab
({
title
:
$
(
'
> legend
'
,
this
).
text
(),
fieldset
:
$
(
this
)
});
list
.
append
(
tab
.
item
);
$
(
this
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment