Skip to content

Commit 73655b6

Browse files
committed
when linking gaps to geogebra objects, use the parent's HTML event
1 parent ac616f1 commit 73655b6

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

geogebra.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,8 +370,12 @@ Numbas.addExtension('geogebra',['jme','math','jme-display'],function(extension)
370370
}
371371
objects.forEach(function(name) {
372372
var part = parts[name];
373-
part.signals.on('HTMLAttached',function() {
374-
part.display.html.addEventListener('focusout',function(e) {
373+
var html_part = part;
374+
while(html_part.parentPart) {
375+
html_part = html_part.parentPart;
376+
}
377+
html_part.signals.on('HTMLAttached',function() {
378+
html_part.display.html.addEventListener('focusout',function(e) {
375379
setTimeout(function() {
376380
var focused = document.activeElement;
377381
var answer_tok = get_part_answer(part,app,name);

0 commit comments

Comments
 (0)