summaryrefslogtreecommitdiff
path: root/js/codeq/problem_list.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/codeq/problem_list.js')
-rw-r--r--js/codeq/problem_list.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/js/codeq/problem_list.js b/js/codeq/problem_list.js
index 853c8cb..cc9e716 100644
--- a/js/codeq/problem_list.js
+++ b/js/codeq/problem_list.js
@@ -200,7 +200,8 @@
Ngroups = groups.length,
html = [],
problemReferences = [],
- group, problems, Nproblems, problem, i, j;
+ group, problems, Nproblems, problem, i, j, nrefs,
+ baseTabIndex = 200; // tabindex attribute of the first problem link
var langDict = convertTranslations(rawTranslations, 'name', 'description'), // this will be the resulting dictionary: multi-level keys that lead up to the lang-dict
groupDict, problemDict;
// title: HTML structure for "name" and "desc"
@@ -218,9 +219,10 @@
problems = group.problems || [];
Nproblems = problems.length;
for (j = 0; j < Nproblems; j++) {
+ nrefs = problemReferences.length;
problem = problems[j] || {};
problemDict = convertTranslations(problem.translations, 'name');
- html.push('<li><a class="problem-', '' + problemReferences.length, '" ', ta(problemDict.name), '></a></li>');
+ html.push('<li><a href="#" tabindex="' + (baseTabIndex+nrefs) + '"' + ' class="problem-', '' + nrefs, '" ', ta(problemDict.name), '></a></li>');
problemReferences.push({'g': group.identifier || 'nogroup', 'p': problem.identifier || 'noproblem', 'id': problem.id});
}
html.push('</ul>');
@@ -254,7 +256,7 @@
ref = data.refs[index];
if (!ref) {
codeq.log.error('Clicked on a problem link having erroneous index: ' + index);
- return;
+ return false;
}
codeq.wait(
Q.all([
@@ -272,6 +274,7 @@
alert('Failed to obtain the problem definition: ' + reason);
})
.done();
+ return false;
});
},