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
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
21 deletions
+16
-21
common/lib/xmodule/xmodule/js/src/conditional/display.coffee
+16
-21
No files found.
common/lib/xmodule/xmodule/js/src/conditional/display.coffee
View file @
f49db1df
...
@@ -3,32 +3,27 @@ class @Conditional
...
@@ -3,32 +3,27 @@ class @Conditional
constructor
:
(
element
)
->
constructor
:
(
element
)
->
@
el
=
$
(
element
).
find
(
'.conditional-wrapper'
)
@
el
=
$
(
element
).
find
(
'.conditional-wrapper'
)
if
@
el
.
data
(
'conditional_module_processed'
)
is
'true'
@
passed
=
@
el
.
data
(
'passed'
)
is
true
console
.
log
'Conditional already processed this element'
if
@
passed
is
true
console
.
log
'Conditional is already passed.'
console
.
log
'Conditional processing this element for the first time.'
return
@
el
.
data
'conditional_module_processed'
,
'true'
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'
)
@
url
=
@
el
.
data
(
'url'
)
@
render
()
@
render
()
$
:
(
selector
)
->
render
:
()
->
$
(
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
$
.
postWithPrefix
"
#{
@
url
}
/conditional_get"
,
(
response
)
=>
$
.
postWithPrefix
"
#{
@
url
}
/conditional_get"
,
(
response
)
=>
console
.
log
response
console
.
log
response
@
el
.
append
(
i
)
for
i
in
response
.
html
XModule
.
loadModules
(
@
el
)
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
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