]> git.proxmox.com Git - mirror_xterm.js.git/commitdiff
Support focus class on the .xterm element
authorDaniel Imms <daimms@microsoft.com>
Tue, 12 Jul 2016 23:18:05 +0000 (16:18 -0700)
committerDaniel Imms <daimms@microsoft.com>
Tue, 12 Jul 2016 23:18:05 +0000 (16:18 -0700)
src/xterm.css
src/xterm.js

index 348fc097f67b72349fc34c8cde5a9689a148d64c..4f1f4796ec4b16d7cc0ef4c727d71bc09ce46a9c 100644 (file)
@@ -43,7 +43,7 @@
     position: relative;
 }
 
-.terminal:focus {
+.terminal.focus {
     outline: none;
 }
 
      * HACK: to fix IE's blinking cursor
      * Move textarea out of the screen to the far left, so that the cursor is not visible.
      */
-    text-indent: -9999em;
+    /*text-indent: -9999em;
     opacity: 0;
     width: 0;
     height: 0;
-    z-index: -10;
+    z-index: -10;*/
 }
 
 .terminal .terminal-cursor {
     color: #000;
 }
 
-.terminal:not(:focus) .terminal-cursor {
+.terminal:not(.focus) .terminal-cursor {
     outline: 1px solid #fff;
     outline-offset: -1px;
     background-color: transparent;
 }
 
-.terminal:focus .terminal-cursor.blinking {
+.terminal.focus .terminal-cursor.blinking {
     animation: blink-cursor 1.2s infinite step-end;
 }
 
index 30e6aee5feac8b61906cbeb9b172c7e3cdeddfcb..a33261c0288a3c3391c635e3065bb0ab0b4df5a4 100644 (file)
         this.send('\x1b[I');
       }
 
+      this.element.classList.add('focus');
       this.showCursor();
       this.textarea.focus();
       Terminal.focus = this;
         return;
       }
 
+      this.element.classList.remove('focus');
       this.cursorState = 0;
       this.refresh(this.y, this.y);
       this.textarea.blur();