Commit 5a933f31 by Luciano Barletta

sort

1 parent 6397fe0b
...@@ -64,3 +64,20 @@ function generate(tabs){ ...@@ -64,3 +64,20 @@ function generate(tabs){
} }
console.log(JSON.stringify(dict)); console.log(JSON.stringify(dict));
} }
function sortTabs(){
let tabs = document.getElementById("tabs");
Array.from(tabs.children).sort(
(a,b) => a.children[0].value < b.children[0].value ? -1 : a.children[0].value > b.children[0].value ? 1 : 0
).forEach(
c => tabs.appendChild(c)
)
}
function sortFields(tab){
Array.from(tab.children).sort(
(a,b) => a.children[0].value < b.children[0].value ? -1 : a.children[0].value > b.children[0].value ? 1 : 0
).forEach(
c => tabs.appendChild(c)
)
}
\ No newline at end of file \ No newline at end of file
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!