Commit 366cdf2d by ichuang

workaround for codemirror bug on chrome - click "show answer" does codemirror.refresh()

parent 1eeb9df6
......@@ -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>
......
......@@ -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>
......@@ -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 }'});
});
......
......@@ -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">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment