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
f49db1df
Commit
f49db1df
authored
Feb 12, 2013
by
Valera Rozuvan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changes to stop displaying conditional content multiple times. Work in progress. Part 2.
parent
2cc90479
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
20 deletions
+15
-20
common/lib/xmodule/xmodule/js/src/conditional/display.coffee
+15
-20
No files found.
common/lib/xmodule/xmodule/js/src/conditional/display.coffee
View file @
f49db1df
...
...
@@ -3,32 +3,27 @@ class @Conditional
constructor
:
(
element
)
->
@
el
=
$
(
element
).
find
(
'.conditional-wrapper'
)
if
@
el
.
data
(
'conditional_module_processed'
)
is
'true'
console
.
log
'Conditional already processed this element'
@
passed
=
@
el
.
data
(
'passed'
)
is
true
if
@
passed
is
true
console
.
log
'Conditional is already passed.'
console
.
log
'Conditional processing this element for the first time.'
@
el
.
data
'conditional_module_processed'
,
'true'
return
console
.
log
'Conditional is not passed. Must re-check with server.'
@
id
=
@
el
.
data
(
'problem-id'
)
@
element_id
=
@
el
.
attr
(
'id'
)
@
url
=
@
el
.
data
(
'url'
)
@
render
()
$
:
(
selector
)
->
$
(
selector
,
@
el
)
updateProgress
:
(
response
)
=>
if
response
.
progress_changed
@
el
.
attr
progress
:
response
.
progress_status
@
el
.
trigger
(
'progressChanged'
)
render
:
(
content
)
->
if
content
@
el
.
append
(
i
)
for
i
in
content
XModule
.
loadModules
(
@
el
)
else
render
:
()
->
$
.
postWithPrefix
"
#{
@
url
}
/conditional_get"
,
(
response
)
=>
console
.
log
response
if
((
response
.
passed
is
true
)
&&
(
@
passed
is
false
))
console
.
log
'(response.passed is true) && (@passed is false)'
@
el
.
data
'passed'
,
'true'
@
el
.
append
(
i
)
for
i
in
response
.
html
XModule
.
loadModules
(
@
el
)
XModule
.
loadModules
@
el
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