Option generation function now returns array, rather than flat text

This commit is contained in:
Oliver Walters 2020-08-26 23:04:50 +10:00
parent 02d17378a6
commit 2037474fad

View File

@ -27,7 +27,7 @@ function makeOptionsList(elements, textFunc, valueFunc, titleFunc) {
* - titleFunc: optional function which takes an element and generates a title * - titleFunc: optional function which takes an element and generates a title
*/ */
var html = ``; var options = [];
elements.forEach(function(element) { elements.forEach(function(element) {
@ -45,10 +45,10 @@ function makeOptionsList(elements, textFunc, valueFunc, titleFunc) {
title = titleFunc(element); title = titleFunc(element);
} }
html += makeOption(text, value, title); options.push(makeOption(text, value, title));
}); });
return html; return options;
} }