X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmain%2Fresources%2Fstatic%2Fjavascript%2Fsone.js;h=3e50ee2293e369d42979116cb0a1a2206f64298d;hb=dc78b7c18c5f5040fd85b153764f49e7cd981b13;hp=23c7fffcce799fa8b580937e0d13dfc9493affe2;hpb=5d3b1f31337bfa9e1bd1ce4b6bf5eb95d284568f;p=Sone.git diff --git a/src/main/resources/static/javascript/sone.js b/src/main/resources/static/javascript/sone.js index 23c7fff..3e50ee2 100644 --- a/src/main/resources/static/javascript/sone.js +++ b/src/main/resources/static/javascript/sone.js @@ -297,21 +297,14 @@ function getMenuSone(element) { /** * Generates a list of Sones by concatening the names of the given sones with a - * new line character (“\n”). + * comma. * * @param sones * The sones to format * @returns {String} The created string */ function generateSoneList(sones) { - var soneList = ""; - $.each(sones, function() { - if (soneList != "") { - soneList += ", "; - } - soneList += this.name; - }); - return soneList; + return sones.map(sone => sone.name).join(", ") } /**