diff --git a/example/content/type.wav b/example/content/type.wav index 7329417..0edefb8 100644 Binary files a/example/content/type.wav and b/example/content/type.wav differ diff --git a/src/vtortola.ng-terminal.js b/src/vtortola.ng-terminal.js index 2daf229..2a1e1e9 100644 --- a/src/vtortola.ng-terminal.js +++ b/src/vtortola.ng-terminal.js @@ -266,7 +266,7 @@ var cursor = angular.element(element[0].querySelector('.terminal-cursor')); var consoleInput = angular.element(element[0].querySelector('.terminal-input')); - if(navigator.appVersion.indexOf("MSIE") != -1){ + if(navigator.appVersion.indexOf("Trident") != -1){ element.addClass('damn-ie'); } @@ -279,13 +279,22 @@ cursor.addClass('terminal-cursor-hidden'); }, 500); + var mouseover = false; + element.on('mouseover', function () { + mouseover = true; + }); + element.on('mouseleave', function () { + mouseover = false; + }); + consoleView.on('click', function () { target[0].focus(); element.toggleClass('terminal-focused', true); }); target.on("blur", function (e) { - element.toggleClass('terminal-focused', false); + if(!mouseover) + element.toggleClass('terminal-focused', false); }); target.on("keypress", function (e) {