From 88c8c4144b6e9a3fc8fbb532609fdd4e71ac6100 Mon Sep 17 00:00:00 2001 From: cxt Date: Mon, 5 Dec 2016 17:18:56 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BC=96=E7=A8=8B=E4=BD=9C=E4=B8=9A=E6=96=B0?= =?UTF-8?q?=E5=BB=BA=E5=92=8C=E7=BC=96=E8=BE=91=E7=9A=84=E6=97=B6=E5=80=99?= =?UTF-8?q?=EF=BC=8C=E6=B5=8B=E8=AF=95=E8=BE=93=E5=87=BA=E9=9B=86=E5=BE=88?= =?UTF-8?q?=E9=95=BF=E7=9A=84=E6=98=BE=E7=A4=BA=E4=B8=8D=E5=8F=8B=E5=A5=BD?= =?UTF-8?q?=EF=BC=8C=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_user_programing_attr.html.erb | 17 +++++++++++++---- public/javascripts/course.js | 6 +----- public/javascripts/new_user.js | 6 +----- 3 files changed, 15 insertions(+), 14 deletions(-) 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';