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
747611ea
Commit
747611ea
authored
Oct 05, 2017
by
Harry Rein
Committed by
GitHub
Oct 05, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #16168 from edx/HarryRein/LEARNER-2332-reviews-speed-up
Add loading icon to reviews page.
parents
4fa81352
271f3c9f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
7 deletions
+33
-7
lms/static/sass/features/_course-experience.scss
+13
-0
openedx/features/course_experience/static/course_experience/js/CourseTalkReviews.js
+18
-7
openedx/features/course_experience/templates/course_experience/course_reviews_modules/coursetalk-reviews-fragment.html
+2
-0
No files found.
lms/static/sass/features/_course-experience.scss
View file @
747611ea
...
...
@@ -360,5 +360,18 @@
.course-reviews-tool
{
margin
:
(
$baseline
*
2
)
(
$baseline
*
3
);
position
:
relative
;
text-align
:
center
;
min-height
:
300px
;
.fa.fa-spinner
{
@include
left
(
50%
);
font-size
:
2rem
;
margin-top
:
$baseline
*
3
;
position
:
absolute
;
}
iframe
{
display
:
block
!
important
;
}
}
}
openedx/features/course_experience/static/course_experience/js/CourseTalkReviews.js
View file @
747611ea
...
...
@@ -11,21 +11,32 @@ export class CourseTalkReviews { // eslint-disable-line import/prefer-default-e
// Initialize page to the read reviews view
self
.
currentSrc
=
options
.
readSrc
;
$
.
getScript
(
options
.
readSrc
);
$
.
getScript
(
options
.
readSrc
,
()
=>
{
// eslint-disable-line func-names
$
(
'iframe'
).
load
(()
=>
{
$
(
options
.
loadIcon
).
hide
();
});
});
$courseTalkToggleReadWriteReviews
.
text
(
toWriteBtnText
);
$courseTalkToggleReadWriteReviews
.
on
(
'click'
,
()
=>
{
const
switchToReadView
=
self
.
currentSrc
===
options
.
writeSrc
;
// Cache js file for future button clicks
$
.
ajaxSetup
({
cache
:
true
});
// Show the loading icon
$
(
options
.
loadIcon
).
show
();
// Update toggle button text
const
newBtnText
=
switchToReadView
?
toWriteBtnText
:
toReadBtnText
;
$courseTalkToggleReadWriteReviews
.
text
(
newBtnText
);
// Toggle the new coursetalk script object
const
switchToReadView
=
self
.
currentSrc
===
options
.
writeSrc
;
self
.
currentSrc
=
switchToReadView
?
options
.
readSrc
:
options
.
writeSrc
;
$
.
getScript
(
self
.
currentSrc
);
// Toggle button text on switch to the other view
const
newText
=
switchToReadView
?
toWriteBtnText
:
toReadBtnText
;
$courseTalkToggleReadWriteReviews
.
text
(
newText
);
$
.
getScript
(
self
.
currentSrc
,
()
=>
{
// eslint-disable-line func-names
$
(
'iframe'
).
load
(()
=>
{
$
(
options
.
loadIcon
).
hide
();
})
;
}
);
});
}
}
openedx/features/course_experience/templates/course_experience/course_reviews_modules/coursetalk-reviews-fragment.html
View file @
747611ea
...
...
@@ -12,6 +12,7 @@ from openedx.features.course_experience import SHOW_REVIEWS_TOOL_FLAG
% if SHOW_REVIEWS_TOOL_FLAG.is_enabled(course.id):
<div
class=
"coursetalk-read-reviews"
>
<span
class=
"fa fa-spinner fa-spin"
aria-hidden=
"true"
></span>
## Coursetalk Widget
<div
id=
"ct-custom-read-review-widget"
data-provider=
"${platform_key}"
data-course=
"${course.id}"
></div>
</div>
...
...
@@ -20,6 +21,7 @@ from openedx.features.course_experience import SHOW_REVIEWS_TOOL_FLAG
<
%
static:webpack
entry=
"CourseTalkReviews"
>
new CourseTalkReviews({
toggleButton: '.toggle-read-write-reviews',
loadIcon: '.coursetalk-read-reviews .fa.fa-spinner',
readSrc: "${settings.COURSE_TALK_READ_ONLY_SOURCE | n, js_escaped_string}",
writeSrc: "${settings.COURSE_TALK_WRITE_ONLY_SOURCE | n, js_escaped_string}"
});
...
...
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