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
366cdf2d
Commit
366cdf2d
authored
Jun 02, 2012
by
ichuang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
workaround for codemirror bug on chrome - click "show answer" does codemirror.refresh()
parent
1eeb9df6
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
6 deletions
+15
-6
templates/dogfood.html
+4
-0
templates/main.html
+4
-0
templates/problem.js
+6
-5
templates/textbox.html
+1
-1
No files found.
templates/dogfood.html
View file @
366cdf2d
...
...
@@ -105,6 +105,10 @@
## image input: for clicking on images (see imageinput.html)
<script
type=
"text/javascript"
src=
"/static/js/imageinput.js"
></script>
<script
type=
"text/javascript"
>
var
codemirror_set
=
{};
// associative array of codemirror objects
</script>
<
%
block
name=
"js_extra"
/>
</body>
...
...
templates/main.html
View file @
366cdf2d
...
...
@@ -131,6 +131,10 @@
<script
type=
"text/javascript"
src=
"${static.url('js/schematic.js')}"
></script>
<script
type=
"text/javascript"
src=
"${static.url('js/cktsim.js')}"
></script>
<script
type=
"text/javascript"
>
var
codemirror_set
=
{};
// associative array of codemirror objects
</script>
<
%
block
name=
"js_extra"
/>
</body>
</html>
templates/problem.js
View file @
366cdf2d
...
...
@@ -15,10 +15,6 @@ function ${ id }_content_updated() {
};
});
// for (var key in codemirror_set) {
// codemirror_set[key].refresh();
// }
$
(
'#check_${ id }'
).
unbind
(
'click'
).
click
(
function
()
{
$
(
"input.schematic"
).
each
(
function
(
index
,
element
){
element
.
schematic
.
update_value
();
});
$
(
".CodeMirror"
).
each
(
function
(
index
,
element
){
if
(
element
.
CodeMirror
.
save
)
element
.
CodeMirror
.
save
();
});
...
...
@@ -67,7 +63,8 @@ function ${ id }_content_updated() {
break
;
default
:
alert
(
json
.
success
);
}}
}
}
);
log_event
(
'problem_check'
,
submit_data
);
});
...
...
@@ -100,6 +97,10 @@ function ${ id }_content_updated() {
}
});
for
(
var
key
in
codemirror_set
)
{
codemirror_set
[
key
].
refresh
();
}
log_event
(
'problem_show'
,
{
'problem'
:
'${ id }'
});
});
...
...
templates/textbox.html
View file @
366cdf2d
...
...
@@ -30,7 +30,7 @@ $(function(){
%
endif
});
cm
.
refresh
();
//
codemirror_set["${id}"] = cm; // track it for refreshes
codemirror_set
[
"${id}"
]
=
cm
;
// track it for refreshes
});
</script>
<style
type=
"text/css"
>
...
...
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