bootstrapify quickhelp

This commit is contained in:
MinRK 2013-06-11 11:26:21 -07:00
parent b2d9b9beb8
commit 167a734964
3 changed files with 11 additions and 13 deletions

View File

@ -65,10 +65,7 @@ IPython.dialog = (function (IPython) {
});
}
dialog.modal(options);
// setTimeout(function() {
// footer.find("button").last().focus()
// }, 0);
return dialog.modal(options);
}
return {

View File

@ -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

View File

@ -48,7 +48,6 @@
border: none;
}
.list_item {
&:hover .list_item {
background-color: #ddd;