From e8d45d80e7423803bf727280e5fb0cbcc7f06be8 Mon Sep 17 00:00:00 2001 From: Ben Vanik Date: Mon, 23 Dec 2013 20:03:03 -0800 Subject: [PATCH] Console scrolls with log. --- debugger/assets/ui/console/console.html | 2 +- debugger/src/directives.js | 15 +++++++++++++-- debugger/src/filters.js | 6 +++--- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/debugger/assets/ui/console/console.html b/debugger/assets/ui/console/console.html index d1a485271..2f674513b 100644 --- a/debugger/assets/ui/console/console.html +++ b/debugger/assets/ui/console/console.html @@ -1,6 +1,6 @@
-
+
  • {{line}}
diff --git a/debugger/src/directives.js b/debugger/src/directives.js index 8790acf7c..fd24f22dd 100644 --- a/debugger/src/directives.js +++ b/debugger/src/directives.js @@ -14,7 +14,7 @@ var module = angular.module('xe.directives', []); module.directive('uiEnter', function() { return function($scope, element, attrs) { - element.bind("keydown keypress", function(e) { + element.bind('keydown keypress', function(e) { if(e.which === 13) { $scope.$apply(function(){ $scope.$eval(attrs.uiEnter); @@ -27,7 +27,7 @@ module.directive('uiEnter', function() { module.directive('uiEscape', function() { return function($scope, element, attrs) { - element.bind("keydown keypress", function(e) { + element.bind('keydown keypress', function(e) { if(e.which === 27) { $scope.$apply(function(){ $scope.$eval(attrs.uiEscape); @@ -38,3 +38,14 @@ module.directive('uiEscape', function() { }; }); +module.directive('uiScrollDownOn', function() { + return { + priority: 1, + link: function($scope, element, attrs) { + $scope.$watch(attrs.uiScrollDownOn, function() { + element[0].scrollTop = element[0].scrollHeight; + }); + } + }; +}); + diff --git a/debugger/src/filters.js b/debugger/src/filters.js index 0ebf9eb78..9cb2d144e 100644 --- a/debugger/src/filters.js +++ b/debugger/src/filters.js @@ -12,11 +12,11 @@ var module = angular.module('xe.filters', []); -module.filter("hex32", function() { +module.filter('hex32', function() { return function(number) { if (number !== null && number !== undefined) { - var str = "" + number.toString(16).toUpperCase(); - while (str.length < 8) str = "0" + str; + var str = '' + number.toString(16).toUpperCase(); + while (str.length < 8) str = '0' + str; return str; } };