Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sample-themes
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
sample-themes
Commits
0ccf711c
Commit
0ccf711c
authored
Dec 27, 2016
by
Hasnain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WL-890 | Fix the course detail page sticky bar.
parent
0c73c8f6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
25 deletions
+25
-25
edx-platform/example/lms/static/js/sticky.js
+25
-25
No files found.
edx-platform/example/lms/static/js/sticky.js
View file @
0ccf711c
...
@@ -9,45 +9,45 @@ $(document).ready(function() {
...
@@ -9,45 +9,45 @@ $(document).ready(function() {
'use strict'
;
'use strict'
;
var
makeSticky
=
function
()
{
var
makeSticky
=
function
()
{
$el
.
css
({
$el
.
css
({
position
:
'fixed'
,
'position'
:
'fixed'
,
top
:
0
,
'top'
:
0
,
width
:
'100%'
,
'width'
:
'100%'
,
'z-index'
:
'10'
,
'z-index'
:
'10'
,
'box-shadow'
:
'0px 1px 5px rgba(0,0,0,0.5)'
'box-shadow'
:
'0px 1px 5px rgba(0,0,0,0.5)'
});
});
$
(
'.sticky-course-title'
).
removeClass
(
'hidden'
);
$
(
".sticky-course-title"
).
removeClass
(
"hidden"
);
$
(
'.course-run'
).
addClass
(
'hidden'
);
$
(
".course-run"
).
addClass
(
"hidden"
);
};
};
var
removeSticky
=
function
()
{
var
removeSticky
=
function
()
{
$el
.
css
({
$el
.
css
({
position
:
'static'
,
'position'
:
'static'
,
'z-index'
:
'0'
,
'z-index'
:
'0'
,
'box-shadow'
:
'none'
'box-shadow'
:
'none'
});
});
$
(
'.sticky-course-title'
).
addClass
(
'hidden'
);
$
(
".sticky-course-title"
).
addClass
(
"hidden"
);
$
(
'.course-run'
).
removeClass
(
'hidden'
);
$
(
".course-run"
).
removeClass
(
"hidden"
);
};
};
var
initializeSticky
=
function
()
{
var
initializeSticky
=
function
()
{
var
windowTop
=
''
;
var
windowTop
=
''
;
if
(
$el
.
length
)
{
// Element should exist
if
(
$
(
window
).
width
()
>=
MIN_WEB_WIDTH
){
$
(
window
).
scroll
(
function
()
{
windowTop
=
$
(
window
).
scrollTop
();
if
(
$
(
window
).
width
()
>=
MIN_WEB_WIDTH
)
{
if
(
stickyBarTop
<
windowTop
){
windowTop
=
$
(
window
).
scrollTop
();
makeSticky
();
if
(
stickyBarTop
<
windowTop
)
{
}
makeSticky
();
else
{
}
else
{
removeSticky
();
removeSticky
();
}
}
}
});
}
}
};
else
{
initializeSticky
();
$
(
window
).
resize
(
function
()
{
if
(
$
(
window
).
width
()
>=
MIN_WEB_WIDTH
)
{
makeSticky
();
}
else
{
removeSticky
();
removeSticky
();
}
}
};
if
(
$el
.
length
)
{
//Element should exist
$
(
window
).
scroll
(
function
(){
initializeSticky
();
});
}
$
(
window
).
resize
(
function
()
{
initializeSticky
()
});
});
});
});
Write
Preview
Markdown
is supported
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