Adding shift-enter support.

This commit is contained in:
Brian Granger 2011-03-17 21:24:37 -07:00 committed by Brian E. Granger
parent 360b6bf6ab
commit 94647cfbb1

View File

@ -17,11 +17,14 @@ var Notebook = function (selector) {
Notebook.prototype.bind_events = function () {
var that = this;
that.element.keydown(function (event) {
// console.log(event);
console.log(event);
if (event.which == 38 && event.shiftKey) {
that.select_prev();
} else if (event.which == 40 && event.shiftKey) {
that.select_next();
} else if (event.which == 13 && event.shiftKey) {
// The focus is not quite working here.
that.insert_code_cell_after();
}
});
};