summary refs log tree commit diff
path: root/webclient/room/room-directive.js
diff options
context:
space:
mode:
Diffstat (limited to 'webclient/room/room-directive.js')
-rw-r--r--webclient/room/room-directive.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/webclient/room/room-directive.js b/webclient/room/room-directive.js
index 8db4cb5d9a..d5108b5f1c 100644
--- a/webclient/room/room-directive.js
+++ b/webclient/room/room-directive.js
@@ -135,6 +135,21 @@ angular.module('RoomController')
         });
     };
 }])
+.directive('commandHistory', [ function() {
+    return function (scope, element, attrs) {
+        element.bind("keydown keypress", function (event) {
+            var keycodePressed = event.which;
+            var UP_ARROW = 38;
+            var DOWN_ARROW = 40;
+            if (keycodePressed === UP_ARROW) {
+                scope.history.goUp(event);
+            }
+            else if (keycodePressed === DOWN_ARROW) {
+                scope.history.goDown(event);
+            } 
+        });
+    }
+}])
 
 // A directive to anchor the scroller position at the bottom when the browser is resizing.
 // When the screen resizes, the bottom of the element remains the same, not the top.