Automatically scroll the live test textarea to the bottom when new content is added

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@44225 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 83095316
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
</item> </item>
<item> <item>
<key> <string>_EtagSupport__etag</string> </key> <key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts99744741.3</string> </value> <value> <string>ts00095498.85</string> </value>
</item> </item>
<item> <item>
<key> <string>__name__</string> </key> <key> <string>__name__</string> </key>
...@@ -52,13 +52,16 @@ ...@@ -52,13 +52,16 @@
});\n });\n
var last_call = false;\n var last_call = false;\n
var data_size = 0;\n var data_size = 0;\n
var data_textarea = undefined;\n
get_data = function() {\n get_data = function() {\n
return $.get(my_url_read_test,\n return $.get(my_url_read_test,\n
{position : data_size},\n {position : data_size},\n
function(data){\n function(data){\n
if ( data.length != undefined ) {\n if ( data.length != undefined ) {\n
data_size = data_size + data.length;\n data_size = data_size + data.length;\n
jQuery("*[name=\'field_your_text_output\']")[0].defaultValue += data ;\n data_textarea = jQuery("*[name=\'field_your_text_output\']")[0];\n
data_textarea.defaultValue += data;\n
data_textarea.scrollTop = data_textarea.scrollHeight;\n
}\n }\n
if (continue_loop == true) {\n if (continue_loop == true) {\n
setTimeout("get_data()",1000);\n setTimeout("get_data()",1000);\n
...@@ -83,7 +86,7 @@ ...@@ -83,7 +86,7 @@
</item> </item>
<item> <item>
<key> <string>size</string> </key> <key> <string>size</string> </key>
<value> <int>1658</int> </value> <value> <int>1813</int> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
......
10 11
\ No newline at end of file \ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment