Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Chill-project
Chill-Main
Commits
654789d4
Commit
654789d4
authored
Nov 28, 2014
by
Marc Ducobu
Browse files
Sticky for not firefox
parent
474abdf3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Resources/views/layout.html.twig
View file @
654789d4
...
...
@@ -165,6 +165,41 @@
});
$
(
'
.select2
'
).
select2
();
$
(
'
.sticky-form-buttons
'
).
each
(
function
(
i
,
stick_element
)
{
if
(
$
(
stick_element
).
css
(
'
position
'
)
!==
'
sticky
'
)
{
var
sticky_form_buttons_offset_top
=
$
(
stick_element
).
offset
().
top
;
function
stickyEmulate
()
{
if
((
$
(
window
).
scrollTop
()
+
$
(
window
).
height
())
<
sticky_form_buttons_offset_top
)
{
//sticky at bottom
$
(
stick_element
).
css
(
'
position
'
,
'
fixed
'
);
$
(
stick_element
).
css
(
'
bottom
'
,
'
0
'
);
$
(
stick_element
).
css
(
'
top
'
,
''
);
$
(
stick_element
).
css
(
'
width
'
,
$
(
stick_element
).
parent
().
outerWidth
());
}
else
if
(
sticky_form_buttons_offset_top
<
$
(
window
).
scrollTop
())
{
//sticky at top
$
(
stick_element
).
css
(
'
position
'
,
'
fixed
'
);
$
(
stick_element
).
css
(
'
top
'
,
'
0
'
);
$
(
stick_element
).
css
(
'
bottom
'
,
''
);
$
(
stick_element
).
css
(
'
width
'
,
$
(
stick_element
).
parent
().
outerWidth
());
}
else
{
//no sticky
$
(
stick_element
).
css
(
'
position
'
,
'
initial
'
);
$
(
stick_element
).
css
(
'
bottom
'
,
''
);
$
(
stick_element
).
css
(
'
width
'
,
''
);
$
(
stick_element
).
css
(
'
top
'
,
''
);
}
}
$
(
window
).
scroll
(
function
()
{
stickyEmulate
();
});
stickyEmulate
();
}
});
</script>
</body>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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