mirror of
https://github.com/jupyter/notebook.git
synced 2025-02-05 12:19:58 +08:00
bootstrapify quickhelp
This commit is contained in:
parent
b2d9b9beb8
commit
167a734964
@ -65,10 +65,7 @@ IPython.dialog = (function (IPython) {
|
||||
});
|
||||
}
|
||||
|
||||
dialog.modal(options);
|
||||
// setTimeout(function() {
|
||||
// footer.find("button").last().focus()
|
||||
// }, 0);
|
||||
return dialog.modal(options);
|
||||
}
|
||||
|
||||
return {
|
||||
|
@ -19,12 +19,11 @@ var IPython = (function (IPython) {
|
||||
var that = this;
|
||||
if ( this.shortcut_dialog ){
|
||||
// if dialog is already shown, close it
|
||||
this.shortcut_dialog.dialog("close");
|
||||
this.shortcut_dialog.find("button").first().click();
|
||||
this.shortcut_dialog = null;
|
||||
return;
|
||||
}
|
||||
var dialog = $('<div/>');
|
||||
this.shortcut_dialog = dialog;
|
||||
var body = $('<div/>');
|
||||
var shortcuts = [
|
||||
{key: 'Shift-Enter', help: 'run cell'},
|
||||
{key: 'Ctrl-Enter', help: 'run cell in-place'},
|
||||
@ -53,16 +52,19 @@ var IPython = (function (IPython) {
|
||||
{key: 'Ctrl-m h', help: 'show keyboard shortcuts'}
|
||||
];
|
||||
for (var i=0; i<shortcuts.length; i++) {
|
||||
dialog.append($('<div>').
|
||||
body.append($('<div>').
|
||||
append($('<span/>').addClass('shortcut_key').html(shortcuts[i].key)).
|
||||
append($('<span/>').addClass('shortcut_descr').html(' : ' + shortcuts[i].help))
|
||||
);
|
||||
};
|
||||
dialog.bind('dialogclose', function(event) {
|
||||
// dialog has been closed, allow it to be drawn again.
|
||||
that.shortcut_dialog = null;
|
||||
this.shortcut_dialog = IPython.dialog.modal({
|
||||
title : "Keyboard shortcuts",
|
||||
body : body,
|
||||
buttons : {
|
||||
Close : {}
|
||||
}
|
||||
});
|
||||
dialog.dialog({title: 'Keyboard shortcuts', closeText: ''});
|
||||
console.log(dialog);
|
||||
};
|
||||
|
||||
// Set module variables
|
||||
|
@ -48,7 +48,6 @@
|
||||
border: none;
|
||||
}
|
||||
|
||||
|
||||
.list_item {
|
||||
&:hover .list_item {
|
||||
background-color: #ddd;
|
||||
|
Loading…
Reference in New Issue
Block a user