Эх сурвалжийг харах

HUE-660 fix for scroll in Google Chrome

Enrico Berti 13 жил өмнө
parent
commit
80eb4698b2

+ 3 - 3
apps/shell/src/shell/templates/index.mako

@@ -109,7 +109,6 @@ from desktop.views import commonheader, commonfooter
 	</div>
   % endif
 
-
 <script type="text/javascript" charset="utf-8">
 	$(document).ready(function(){
 		var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
@@ -159,7 +158,7 @@ from desktop.views import commonheader, commonfooter
 								_out = _out.replace(/>/g, '&gt;');
 								_out = _out.replace(/</g, '&lt;');
 								_out = _out.replace(/\n/g, '<br />');
-								$("#shellContent").html($("#shellContent").html()+_out);
+								$("#shellContent").html($("#shellContent").html()+"<br/>"+_out);
 								if (_out.indexOf("Disconnected!")>-1){
 									window.setTimeout(function(){
 										$.ajax({
@@ -177,7 +176,7 @@ from desktop.views import commonheader, commonfooter
 										});
 									},500);
 								}
-								$("html").animate({ scrollTop: $(document).height() }, "fast");
+								$("body").animate({ scrollTop: $("#shellInput").offset().top }, "fast");
 								_shell.get(data[_shell.id].nextOffset);
 							}
 						}
@@ -231,6 +230,7 @@ from desktop.views import commonheader, commonfooter
 				}, 50);
 			});
 			$("#shellInput").keydown(function(e){
+				$(this).width($(document).width()-100-$(this).position().left);
 				if ((e.keyCode ? e.keyCode : e.which) == 13){
 					shell.send($(this).val());
 					$(this).val("");

+ 5 - 4
apps/shell/src/shell/tests.py

@@ -128,15 +128,16 @@ def test_rest():
   assert "There is no Unix user account for you." in response.content
 
   response = client.get("/shell/create?keyName=%s" % (shell_types_available[0],), follow=True, **d)
-  assert '<span class="shell_id hidden">' in response.content
+  fragment = '<span id="shell_id" class="hidden">'
+  assert fragment in response.content
 
-  shell_id_start = response.content.index('<span class="shell_id hidden">')+len('<span class="shell_id hidden">')
-  shell_id_end = response.content.index('</span>')
+  shell_id_start = response.content.index(fragment) + len(fragment)
+  shell_id_end = response.content.index('</span>', shell_id_start)
   shell_id = response.content[shell_id_start:shell_id_end]
   assert re.match(r"^\s*\d+\s*$", shell_id)
 
   response = client.post("/shell/kill_shell", follow=True, data={constants.SHELL_ID: shell_id}, **d)
-  assert response.content.strip() == "Shell successfully killed"
+  assert 'Shell successfully marked for cleanup' in response.content
 
 def test_parse_shell_pairs():
   request = TestRequest()