Widget:FaqViewer: Difference between revisions
Jump to navigation
Jump to search
Matt Pijoan (talk | contribs) No edit summary |
Matt Pijoan (talk | contribs) No edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 721: | Line 721: | ||
} else if(sub.indexOf(',' != -1)){ | } else if(sub.indexOf(',' != -1)){ | ||
var subSplit = sub.split(','); | var subSplit = sub.split(','); | ||
$.each(subSplit, function(subI, subVal){ | $.each(subSplit, function(subI, subVal){ | ||
pushToClean(main, $.trim(subVal), ques, ans); | pushToClean(main, $.trim(subVal), ques, ans); | ||
Line 743: | Line 742: | ||
} | } | ||
if(cleanJSON[main][sub].length){ | if(cleanJSON[main][sub].length){ | ||
cleanJSON[main][sub].sort(); | |||
cleanJSON[main][sub].push({"question": ques, "answer":ans}); | cleanJSON[main][sub].push({"question": ques, "answer":ans}); | ||
questionList.push(ques); | questionList.push(ques); | ||
Line 755: | Line 755: | ||
$.each(cleanJSON, function(mainKey, mainValue){ | $.each(cleanJSON, function(mainKey, mainValue){ | ||
html += "<h3>"+mainKey+"</h3><div class='accordion'>"; | html += "<h3>"+mainKey+"</h3><div class='accordion'>"; | ||
$.each(mainValue | $.each(mainValue, function(subKey, subValue){ | ||
html += "<h3>"+subKey+"</h3><div class='accordion'>"; | html += "<h3>"+subKey+"</h3><div class='accordion'>"; | ||
$.each(subValue, function(qKey, qValue){ | $.each(subValue, function(qKey, qValue){ |