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
a500b0be
Commit
a500b0be
authored
8 years ago
by
khawkins
Browse files
Options
Downloads
Patches
Plain Diff
Create a dynamic height for the menu bar when stuck, correct jQuery to $
parent
314b94e1
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
+11
-5
11 additions, 5 deletions
js/foundationExtendEBI.js
with
11 additions
and
5 deletions
js/foundationExtendEBI.js
+
11
−
5
View file @
a500b0be
...
...
@@ -32,17 +32,18 @@
// Responsive support for tables
// Clone the class from a parent TH to any child TD
jQuery
(
'
table.responsive-table
'
).
each
(
function
()
{
var
columnsToAppend
=
jQuery
(
this
).
find
(
'
th
'
);
$
(
'
table.responsive-table
'
).
each
(
function
()
{
var
columnsToAppend
=
$
(
this
).
find
(
'
th
'
);
for
(
var
i
=
0
;
i
<
columnsToAppend
.
length
;
i
++
)
{
if
(
jQuery
(
columnsToAppend
[
i
]).
attr
(
'
class
'
))
{
if
(
$
(
columnsToAppend
[
i
]).
attr
(
'
class
'
))
{
var
position
=
i
+
1
;
jQuery
(
this
).
find
(
'
td:nth-child(
'
+
position
+
'
)
'
).
addClass
(
jQuery
(
columnsToAppend
[
i
]).
attr
(
'
class
'
));
$
(
this
).
find
(
'
td:nth-child(
'
+
position
+
'
)
'
).
addClass
(
$
(
columnsToAppend
[
i
]).
attr
(
'
class
'
));
}
};
});
// Smooth scroll anchor links for jQuery users
// -----------
$
(
function
()
{
$
(
'
a[href*=#]:not([href=#])
'
).
click
(
function
()
{
// Table compatibility
...
...
@@ -66,6 +67,11 @@
});
});
// Create a dynamic height for the menu bar when stuck
// -----------
var
desiredStuckMenuHeight
=
$
(
'
#local-masthead .masthead
'
).
outerHeight
();
$
(
"
<style id='dynamic-stuck-height' type='text/css'> div#local-masthead.sticky.is-stuck{ margin-top: -
"
+
desiredStuckMenuHeight
+
"
px !important;} </style>
"
).
appendTo
(
"
body
"
);
// Clone the local menu into a mobile-only menu
// -----------
var
localMenuClass
=
'
#local-masthead .masthead > nav ul.dropdown.menu.float-left
'
;
...
...
@@ -95,7 +101,7 @@
$
(
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
'
).
width
();
// invoke foundation to create dropdown functionality when we add the menu
var
responsiveMenu
=
new
Foundation
.
DropdownMenu
(
jQuery
(
localMenuClass
));
var
responsiveMenu
=
new
Foundation
.
DropdownMenu
(
$
(
localMenuClass
));
}
// loop through each menu item in reverse, and slice off the first as it's the dropdown
...
...
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