Skip to content

Commit 46bb789

Browse files
author
Philip Guo
committed
tiny change to grab kb focus right away
1 parent a8ae994 commit 46bb789

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

PyTutorGAE/js/opt-frontend.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,9 @@ $(document).ready(function() {
109109
// jsPlumb connectors won't render properly
110110
myVisualizer.updateOutput();
111111

112+
// grab focus so that keyboard events work
113+
myVisualizer.grabKeyboardFocus();
114+
112115
// customize edit button click functionality AFTER rendering (TODO: awkward!)
113116
$('#pyOutputPane #editBtn').click(function() {
114117
enterEditMode();

PyTutorGAE/js/pytutor.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,11 @@ ExecutionVisualizer.prototype.setKeyboardBindings = function() {
395395
}
396396

397397

398+
ExecutionVisualizer.prototype.grabKeyboardFocus = function() {
399+
this.domRoot.find('td#left_pane').focus();
400+
}
401+
402+
398403
ExecutionVisualizer.prototype.renderPyCodeOutput = function() {
399404
var myViz = this; // to prevent confusion of 'this' inside of nested functions
400405

0 commit comments

Comments
 (0)