actually fix result's order
This commit is contained in:
parent
edfd9c02ac
commit
bb1e2723e5
1 changed files with 1 additions and 17 deletions
|
@ -153,12 +153,11 @@
|
|||
}
|
||||
|
||||
function show_result(result) {
|
||||
console.log(result);
|
||||
while (resultWrapper.lastElementChild) {
|
||||
resultWrapper.removeChild(resultWrapper.lastElementChild);
|
||||
}
|
||||
|
||||
for (let [ver, val] of Object.entries(result).sort(([k1, v1]) => k1).stableSort(([k1, v1], [k2, v2]) => v2 - v1)) {
|
||||
for (let [ver, val] of Object.entries(result).sortByKey(([k1, v1]) => k1).stableSort(([k1, v1], [k2, v2]) => v2 - v1)) {
|
||||
if(!(ver in _results)) {
|
||||
console.error("No html found for '"+ver+"'");
|
||||
continue;
|
||||
|
@ -177,21 +176,6 @@
|
|||
window.sessionStorage.setItem(state.question.id, JSON.stringify(state.answers));
|
||||
}
|
||||
|
||||
function getSelectValues(select) {
|
||||
var result = [];
|
||||
var options = select && select.options;
|
||||
var opt;
|
||||
|
||||
for (var i=0, iLen=options.length; i<iLen; i++) {
|
||||
opt = options[i];
|
||||
|
||||
if (opt.selected) {
|
||||
result.push(opt.value || opt.text);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
function goNext() {
|
||||
window.history.pushState("object or string", "", createRelativeUrl(state.question.index + 1));
|
||||
depth += 1;
|
||||
|
|
Loading…
Reference in a new issue