Skip to content

Commit

Permalink
Fixed issue #13425: Cannot add subquestions and answer options with p…
Browse files Browse the repository at this point in the history
…lus button
  • Loading branch information
olleharstedt committed Feb 28, 2018
1 parent 796d300 commit b74734b
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions assets/scripts/admin/subquestions.js
Expand Up @@ -274,21 +274,18 @@ function addinput(e)
datas += '&position=',
datas += '&languages='+$languages;


// We get the HTML of the different rows to insert (one by language)
$.ajax({
type: "GET",
url: $url,
data: datas,
success: function(arrayofhtml) {

// arrayofhtml is a json string containing the different HTML row by language
// arrayofhtml is a json object containing the different HTML row by language
// eg: {"en":"{the html of the en row}", "fr":{the html of the fr row}}

$arrayOfHtml = JSON.parse(arrayofhtml); // Convert the JSON to a javascript object

// We insert each row for each language
$.each($arrayOfHtml, function(lang, htmlRow){
$.each(arrayofhtml, function(lang, htmlRow){
$elRowToUpdate = $('#row_'+lang+'_'+$commonId); // The row for the current language
$elRowToUpdate.after(htmlRow); // We insert the HTML of the new row after this one
});
Expand Down

0 comments on commit b74734b

Please sign in to comment.