Skip to content

Commit

Permalink
MSIE Detection and type sound
Browse files Browse the repository at this point in the history
  • Loading branch information
vtortola committed Aug 8, 2014
1 parent 996021f commit 43cd0ec
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Binary file modified example/content/type.wav
Binary file not shown.
13 changes: 11 additions & 2 deletions src/vtortola.ng-terminal.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

Expand All @@ -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) {
Expand Down

0 comments on commit 43cd0ec

Please sign in to comment.