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
5360d77b
Commit
5360d77b
authored
Dec 19, 2014
by
David Baumgold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor sock HTML to have text in Mako template
parent
7366d2b1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
10 deletions
+17
-10
cms/static/js/sock.js
+13
-9
cms/templates/widgets/sock.html
+4
-1
No files found.
cms/static/js/sock.js
View file @
5360d77b
...
@@ -3,12 +3,22 @@ require(["domReady", "jquery", "jquery.smoothScroll"],
...
@@ -3,12 +3,22 @@ require(["domReady", "jquery", "jquery.smoothScroll"],
var
toggleSock
=
function
(
e
)
{
var
toggleSock
=
function
(
e
)
{
e
.
preventDefault
();
e
.
preventDefault
();
var
$btnLabel
=
$
(
this
).
find
(
'.copy'
);
var
$btnShowSockLabel
=
$
(
this
).
find
(
'.copy-show'
);
var
$btnHideSockLabel
=
$
(
this
).
find
(
'.copy-hide'
);
var
$sock
=
$
(
'.wrapper-sock'
);
var
$sock
=
$
(
'.wrapper-sock'
);
var
$sockContent
=
$sock
.
find
(
'.wrapper-inner'
);
var
$sockContent
=
$sock
.
find
(
'.wrapper-inner'
);
$sock
.
toggleClass
(
'is-shown'
);
if
(
$sock
.
hasClass
(
'is-shown'
))
{
$sockContent
.
toggle
(
'fast'
);
$sock
.
removeClass
(
'is-shown'
);
$sockContent
.
hide
(
'fast'
);
$btnHideSockLabel
.
removeClass
(
"is-shown"
).
addClass
(
"is-hidden"
);
$btnShowSockLabel
.
removeClass
(
"is-hidden"
).
addClass
(
"is-shown"
);
}
else
{
$sock
.
addClass
(
'is-shown'
);
$sockContent
.
show
(
'fast'
);
$btnHideSockLabel
.
removeClass
(
"is-hidden"
).
addClass
(
"is-shown"
);
$btnShowSockLabel
.
removeClass
(
"is-shown"
).
addClass
(
"is-hidden"
);
}
$
.
smoothScroll
({
$
.
smoothScroll
({
offset
:
-
200
,
offset
:
-
200
,
...
@@ -17,12 +27,6 @@ require(["domReady", "jquery", "jquery.smoothScroll"],
...
@@ -17,12 +27,6 @@ require(["domReady", "jquery", "jquery.smoothScroll"],
scrollElement
:
null
,
scrollElement
:
null
,
scrollTarget
:
$sock
scrollTarget
:
$sock
});
});
if
(
$sock
.
hasClass
(
'is-shown'
))
{
$btnLabel
.
text
(
gettext
(
'Hide Studio Help'
));
}
else
{
$btnLabel
.
text
(
gettext
(
'Looking for Help with Studio?'
));
}
};
};
domReady
(
function
()
{
domReady
(
function
()
{
...
...
cms/templates/widgets/sock.html
View file @
5360d77b
...
@@ -4,7 +4,10 @@
...
@@ -4,7 +4,10 @@
<div
class=
"wrapper-sock wrapper"
>
<div
class=
"wrapper-sock wrapper"
>
<ul
class=
"list-actions list-cta"
>
<ul
class=
"list-actions list-cta"
>
<li
class=
"action-item"
>
<li
class=
"action-item"
>
<a
href=
"#sock"
class=
"cta cta-show-sock"
><i
class=
"icon-question-sign"
></i>
<span
class=
"copy"
>
${_("Looking for help with {studio_name}?").format(studio_name=settings.STUDIO_NAME)}
</span></a>
<a
href=
"#sock"
class=
"cta cta-show-sock"
><i
class=
"icon-question-sign"
></i>
<span
class=
"copy-show is-shown"
>
${_("Looking for help with {studio_name}?").format(studio_name=settings.STUDIO_NAME)}
</span>
<span
class=
"copy-hide is-hidden"
>
${_("Hide {studio_name} Help").format(studio_name=settings.STUDIO_NAME)}
</span>
</a>
</li>
</li>
</ul>
</ul>
...
...
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