diff --git a/app/views/users/_user_programing_attr.html.erb b/app/views/users/_user_programing_attr.html.erb index d819ab59f..cc9ed5cdc 100644 --- a/app/views/users/_user_programing_attr.html.erb +++ b/app/views/users/_user_programing_attr.html.erb @@ -48,8 +48,8 @@ } if (inputs.length == outputs.length) { for (var i=0; i var text = document.getElementById("textarea_input_test"); var text2 = document.getElementById("textarea_output_test"); - autoTextarea2(text,text2); - autoTextarea2(text2,text); + autoTextarea2(text,text2, 0, 140); + autoTextarea2(text2,text, 0, 140); + <% else %> + var inputs = document.getElementsByName("program[input][]"); + var outputs = document.getElementsByName("program[output][]"); + if (inputs.length == outputs.length) { + for (var i=0; i \ No newline at end of file diff --git a/public/javascripts/course.js b/public/javascripts/course.js index 779b8805c..d9b1226c6 100644 --- a/public/javascripts/course.js +++ b/public/javascripts/course.js @@ -1446,7 +1446,7 @@ var autoTextarea2 = function (elem,elem2, extra, maxHeight) { } : function (name) { return getComputedStyle(elem, null)[name]; }, - minHeight = parseFloat(getFirstStyle('height')) + minHeight = parseFloat(getFirstStyle('height')); elem.style.resize = 'none'; elem2.style.resize = 'none'; @@ -1474,8 +1474,6 @@ var autoTextarea2 = function (elem,elem2, extra, maxHeight) { style2.overflowY = 'auto'; } else { height = elem.scrollHeight - padding; - style.overflowY = 'hidden'; - style2.overflowY = 'hidden'; }; style.height = height + extra + 'px'; style2.height = height + extra + 'px'; @@ -1491,8 +1489,6 @@ var autoTextarea2 = function (elem,elem2, extra, maxHeight) { style2.overflowY = 'auto'; } else { height = elem2.scrollHeight - padding; - style.overflowY = 'hidden'; - style2.overflowY = 'hidden'; }; style.height = height + extra + 'px'; style2.height = height + extra + 'px'; diff --git a/public/javascripts/new_user.js b/public/javascripts/new_user.js index 916481818..600662ab1 100644 --- a/public/javascripts/new_user.js +++ b/public/javascripts/new_user.js @@ -632,7 +632,7 @@ var autoTextarea2 = function (elem,elem2, extra, maxHeight) { } : function (name) { return getComputedStyle(elem, null)[name]; }, - minHeight = parseFloat(getFirstStyle('height')) + minHeight = parseFloat(getFirstStyle('height')); elem.style.resize = 'none'; elem2.style.resize = 'none'; @@ -660,8 +660,6 @@ var autoTextarea2 = function (elem,elem2, extra, maxHeight) { style2.overflowY = 'auto'; } else { height = elem.scrollHeight - padding; - style.overflowY = 'hidden'; - style2.overflowY = 'hidden'; }; style.height = height + extra + 'px'; style2.height = height + extra + 'px'; @@ -677,8 +675,6 @@ var autoTextarea2 = function (elem,elem2, extra, maxHeight) { style2.overflowY = 'auto'; } else { height = elem2.scrollHeight - padding; - style.overflowY = 'hidden'; - style2.overflowY = 'hidden'; }; style.height = height + extra + 'px'; style2.height = height + extra + 'px';