]> git.proxmox.com Git - mirror_xterm.js.git/commitdiff
Fix focus on refresh
authorparis <pariskasidiaris@gmail.com>
Wed, 9 Apr 2014 16:49:29 +0000 (16:49 +0000)
committerparis <pariskasidiaris@gmail.com>
Wed, 9 Apr 2014 16:49:29 +0000 (16:49 +0000)
bower.json
src/xterm.js

index e32285b978310396464e5ff2938915b76d73484f..f61a3395a048336a188209a45fd0159edb4ae7ea 100644 (file)
@@ -1,5 +1,5 @@
 {
   "name": "xterm.js",
-  "version": "0.5",
+  "version": "0.6",
   "ignore": ["demo", "docs", "test", ".gitignore"]
 }
\ No newline at end of file
index ddebbe9893b15fde98aa899fbdfe6d59ee0f5d7b..90caaad93c8d64013fc1e4cff8be9ee3425e62b6 100644 (file)
@@ -953,7 +953,7 @@ Terminal.prototype.destroy = function() {
  *   1=bold, 2=underline, 4=blink, 8=inverse, 16=invisible
 */
 Terminal.prototype.refresh = function(start, end) {
-  var x, y, i, line, out, ch, width, data, attr, bg, fg, flags, row, parent;
+  var x, y, i, line, out, ch, width, data, attr, bg, fg, flags, row, parent, focused = document.activeElement;
 
   if (end - start >= this.rows / 2) {
     parent = this.element.parentNode;
@@ -1086,6 +1086,10 @@ Terminal.prototype.refresh = function(start, end) {
     parent.appendChild(this.element);
   }
   
+  /*
+  *  Return focus to previously focused element
+  */
+  focused.focus();
   this.emit('refresh', {element: this.element, start: start, end: end});
 };