]> git.proxmox.com Git - mirror_xterm.js.git/commitdiff
Merge changes from #828
authormofux <t.zilz@mofux.org>
Wed, 2 Aug 2017 15:42:43 +0000 (17:42 +0200)
committermofux <t.zilz@mofux.org>
Wed, 2 Aug 2017 15:42:43 +0000 (17:42 +0200)
1  2 
src/xterm.js

diff --combined src/xterm.js
index 1bb44a9a3e214bf1ba78d50b9ed04f10c129eb05,d4cb00158c776e2933038d27b187fd041752e7cb..5aa069e796c688b291265b60ae1d1920291a772c
@@@ -429,7 -429,7 +429,7 @@@ Terminal.prototype.setOption = function
    switch (key) {
      case 'cursorBlink': this.setCursorBlinking(value); break;
      case 'cursorStyle':
 -      // Style 'block' applies with no class
 +      this.element.classList.toggle(`xterm-cursor-style-block`, value === 'block');
        this.element.classList.toggle(`xterm-cursor-style-underline`, value === 'underline');
        this.element.classList.toggle(`xterm-cursor-style-bar`, value === 'bar');
        break;
@@@ -639,7 -639,6 +639,7 @@@ Terminal.prototype.open = function(pare
    this.element.classList.add('terminal');
    this.element.classList.add('xterm');
    this.element.classList.add('xterm-theme-' + this.theme);
 +  this.element.classList.add(`xterm-cursor-style-${this.options.cursorStyle}`);
    this.setCursorBlinking(this.options.cursorBlink);
  
    this.element.setAttribute('tabindex', 0);
      this.focus();
    }
  
-   on(this.element, 'click', function() {
-     var selection = document.getSelection(),
-         collapsed = selection.isCollapsed,
-         isRange = typeof collapsed == 'boolean' ? !collapsed : selection.type == 'Range';
-     if (!isRange) {
-       self.focus();
-     }
-   });
    // Listen for mouse events and translate
    // them into terminal mouse protocols.
    this.bindMouse();
@@@ -1026,17 -1016,14 +1017,17 @@@ Terminal.prototype.bindMouse = function
    }
  
    on(el, 'mousedown', function(ev) {
-     // prevent the focus on the textarea from getting lost
 -    // ensure focus
++
++    // Prevent the focus on the textarea from getting lost
++    // and make sure we get focused on mousedown
 +    ev.preventDefault();
+     self.focus();
  
      if (!self.mouseEvents) return;
  
      // send the button
      sendButton(ev);
  
-     // ensure focus
-     self.focus();
      // fix for odd bug
      //if (self.vt200Mouse && !self.normalMouse) {
      if (self.vt200Mouse) {
@@@ -2205,7 -2192,7 +2196,7 @@@ Terminal.prototype.ch = function(cur) 
  
  
  /**
-  * Evaluate if the current erminal is the given argument.
+  * Evaluate if the current terminal is the given argument.
   * @param {object} term The terminal to evaluate
   */
  Terminal.prototype.is = function(term) {