Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
EBI-Framework
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Operate
Environments
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ebiwd
EBI-Framework
Commits
48a30fb0
Commit
48a30fb0
authored
8 years ago
by
khawkins
Browse files
Options
Downloads
Patches
Plain Diff
Responsive nav fix for #42
Increase specificity of grabbing child <li> tags
parent
7f8f5fe1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
js/foundationExtendEBI.js
+5
-5
5 additions, 5 deletions
js/foundationExtendEBI.js
with
5 additions
and
5 deletions
js/foundationExtendEBI.js
+
5
−
5
View file @
48a30fb0
...
...
@@ -271,7 +271,7 @@ if (jQuery('body').hasClass('google-analytics-loaded')) {
// Create dropdown if needed
if
(
$
(
localMenuClass
+
'
li.extra-items-menu
'
).
length
==
0
)
{
$
(
localMenuClass
).
append
(
'
<li class="extra-items-menu"><a href="#">Also in this section</a><ul class="menu"></ul></li>
'
);
localMenuWidthUsed
=
localMenuWidthUsed
+
$
(
localMenuClass
+
'
li.extra-items-menu
'
).
outerWidth
();
// Account for width of li.extra-items-menu
localMenuWidthUsed
=
localMenuWidthUsed
+
$
(
localMenuClass
+
'
>
li.extra-items-menu
'
).
outerWidth
();
// Account for width of li.extra-items-menu
// invoke foundation to create dropdown functionality when we add the menu
var
responsiveMenu
=
new
Foundation
.
DropdownMenu
(
$
(
localMenuClass
));
}
...
...
@@ -280,7 +280,7 @@ if (jQuery('body').hasClass('google-analytics-loaded')) {
$
(
$
(
localMenuClass
+
'
> li
'
).
get
().
reverse
().
slice
(
1
)).
each
(
function
()
{
if
(
localMenuWidthUsed
>
localMenuWidthAvail
)
{
// do we need to hide more items?
localMenuWidthUsed
=
localMenuWidthUsed
-
$
(
this
).
outerWidth
();
$
(
this
).
detach
().
prependTo
(
localMenuClass
+
'
li.extra-items-menu ul.menu
'
);
$
(
this
).
detach
().
prependTo
(
localMenuClass
+
'
>
li.extra-items-menu
>
ul.menu
'
);
}
// we could break when <= but this should be pretty fast
});
}
...
...
@@ -296,11 +296,11 @@ if (jQuery('body').hasClass('google-analytics-loaded')) {
// as the dropdown menu is the width of longest menu item, it's not practical to get the length of each,
// so if the longest item could fit, we'll restore an item
var
spaceRequiredForFirstHiddenChild
=
$
(
localMenuClass
+
'
li.extra-items-menu ul.menu li:first-child
'
).
outerWidth
();
var
spaceRequiredForFirstHiddenChild
=
$
(
localMenuClass
+
'
li.extra-items-menu
>
ul.menu
>
li:first-child
'
).
outerWidth
();
while
(
spaceToWorkWith
>
spaceRequiredForFirstHiddenChild
)
{
spaceToWorkWith
=
spaceToWorkWith
-
spaceRequiredForFirstHiddenChild
;
$
(
localMenuClass
+
'
li.extra-items-menu ul.menu li:first-child
'
).
detach
().
insertBefore
(
localMenuClass
+
'
li.extra-items-menu
'
);
if
(
$
(
localMenuClass
+
'
li.extra-items-menu li
'
).
length
==
1
)
{
$
(
localMenuClass
+
'
li.extra-items-menu
>
ul.menu
>
li:first-child
'
).
detach
().
insertBefore
(
localMenuClass
+
'
li.extra-items-menu
'
);
if
(
$
(
localMenuClass
+
'
>
li.extra-items-menu
> ul >
li
'
).
length
==
1
)
{
// exit if just 1 item left in menu
break
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
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!
Save comment
Cancel
Please
register
or
sign in
to comment