Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
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
edx-platform
Commits
54498e15
Commit
54498e15
authored
Oct 15, 2013
by
Christina Roberts
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1328 from edx/christina/toggle-sock
Move sock JS code into its own file.
parents
fae5a5ff
6a7b88df
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
28 deletions
+35
-28
cms/static/js/base.js
+0
-28
cms/static/js/sock.js
+32
-0
cms/templates/base.html
+3
-0
No files found.
cms/static/js/base.js
View file @
54498e15
...
...
@@ -94,9 +94,6 @@ domReady(function() {
// tender feedback window scrolling
$
(
'a.show-tender'
).
bind
(
'click'
,
smoothScrollTop
);
// toggling footer additional support
$
(
'.cta-show-sock'
).
bind
(
'click'
,
toggleSock
);
// toggling overview section details
$
(
function
()
{
if
(
$
(
'.courseware-section'
).
length
>
0
)
{
...
...
@@ -420,31 +417,6 @@ function hideModal(e) {
}
}
function
toggleSock
(
e
)
{
e
.
preventDefault
();
var
$btnLabel
=
$
(
this
).
find
(
'.copy'
);
var
$sock
=
$
(
'.wrapper-sock'
);
var
$sockContent
=
$sock
.
find
(
'.wrapper-inner'
);
$sock
.
toggleClass
(
'is-shown'
);
$sockContent
.
toggle
(
'fast'
);
$
.
smoothScroll
({
offset
:
-
200
,
easing
:
'swing'
,
speed
:
1000
,
scrollElement
:
null
,
scrollTarget
:
$sock
});
if
(
$sock
.
hasClass
(
'is-shown'
))
{
$btnLabel
.
text
(
gettext
(
'Hide Studio Help'
));
}
else
{
$btnLabel
.
text
(
gettext
(
'Looking for Help with Studio?'
));
}
}
function
toggleSubmodules
(
e
)
{
e
.
preventDefault
();
$
(
this
).
toggleClass
(
'expand'
).
toggleClass
(
'collapse'
);
...
...
cms/static/js/sock.js
0 → 100644
View file @
54498e15
require
([
"domReady"
,
"jquery"
,
"jquery.smoothScroll"
],
function
(
domReady
,
$
)
{
var
toggleSock
=
function
(
e
)
{
e
.
preventDefault
();
var
$btnLabel
=
$
(
this
).
find
(
'.copy'
);
var
$sock
=
$
(
'.wrapper-sock'
);
var
$sockContent
=
$sock
.
find
(
'.wrapper-inner'
);
$sock
.
toggleClass
(
'is-shown'
);
$sockContent
.
toggle
(
'fast'
);
$
.
smoothScroll
({
offset
:
-
200
,
easing
:
'swing'
,
speed
:
1000
,
scrollElement
:
null
,
scrollTarget
:
$sock
});
if
(
$sock
.
hasClass
(
'is-shown'
))
{
$btnLabel
.
text
(
gettext
(
'Hide Studio Help'
));
}
else
{
$btnLabel
.
text
(
gettext
(
'Looking for Help with Studio?'
));
}
};
domReady
(
function
()
{
// toggling footer additional support
$
(
'.cta-show-sock'
).
bind
(
'click'
,
toggleSock
);
});
});
cms/templates/base.html
View file @
54498e15
...
...
@@ -200,6 +200,9 @@ require(['js/models/course'], function(Course) {
<
%
block
name=
"content"
></
%
block>
% if user.is_authenticated():
<script
type=
"text/javascript"
>
require
([
'js/sock'
]);
</script>
<
%
include
file=
"widgets/sock.html"
/>
% endif
...
...
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