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
6a7b88df
Commit
6a7b88df
authored
Oct 11, 2013
by
cahrens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move sock JS code into its own file.
parent
a5aca51a
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 @
6a7b88df
...
@@ -94,9 +94,6 @@ domReady(function() {
...
@@ -94,9 +94,6 @@ domReady(function() {
// tender feedback window scrolling
// tender feedback window scrolling
$
(
'a.show-tender'
).
bind
(
'click'
,
smoothScrollTop
);
$
(
'a.show-tender'
).
bind
(
'click'
,
smoothScrollTop
);
// toggling footer additional support
$
(
'.cta-show-sock'
).
bind
(
'click'
,
toggleSock
);
// toggling overview section details
// toggling overview section details
$
(
function
()
{
$
(
function
()
{
if
(
$
(
'.courseware-section'
).
length
>
0
)
{
if
(
$
(
'.courseware-section'
).
length
>
0
)
{
...
@@ -423,31 +420,6 @@ function hideModal(e) {
...
@@ -423,31 +420,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
)
{
function
toggleSubmodules
(
e
)
{
e
.
preventDefault
();
e
.
preventDefault
();
$
(
this
).
toggleClass
(
'expand'
).
toggleClass
(
'collapse'
);
$
(
this
).
toggleClass
(
'expand'
).
toggleClass
(
'collapse'
);
...
...
cms/static/js/sock.js
0 → 100644
View file @
6a7b88df
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 @
6a7b88df
...
@@ -200,6 +200,9 @@ require(['js/models/course'], function(Course) {
...
@@ -200,6 +200,9 @@ require(['js/models/course'], function(Course) {
<
%
block
name=
"content"
></
%
block>
<
%
block
name=
"content"
></
%
block>
% if user.is_authenticated():
% if user.is_authenticated():
<script
type=
"text/javascript"
>
require
([
'js/sock'
]);
</script>
<
%
include
file=
"widgets/sock.html"
/>
<
%
include
file=
"widgets/sock.html"
/>
% endif
% 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