From 28f1de1081dc7df851f8cc597ba0ca1a6111b9c9 2013-06-11 18:26:21 From: MinRK Date: 2013-06-11 18:26:21 Subject: [PATCH] bootstrapify quickhelp --- diff --git a/IPython/frontend/html/notebook/static/base/js/dialog.js b/IPython/frontend/html/notebook/static/base/js/dialog.js index a792a17..92d2e3c 100644 --- a/IPython/frontend/html/notebook/static/base/js/dialog.js +++ b/IPython/frontend/html/notebook/static/base/js/dialog.js @@ -65,10 +65,7 @@ IPython.dialog = (function (IPython) { }); } - dialog.modal(options); - // setTimeout(function() { - // footer.find("button").last().focus() - // }, 0); + return dialog.modal(options); } return { diff --git a/IPython/frontend/html/notebook/static/notebook/js/quickhelp.js b/IPython/frontend/html/notebook/static/notebook/js/quickhelp.js index 5bf0b19..3473a41 100644 --- a/IPython/frontend/html/notebook/static/notebook/js/quickhelp.js +++ b/IPython/frontend/html/notebook/static/notebook/js/quickhelp.js @@ -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 = $('
'); - this.shortcut_dialog = dialog; + var body = $('
'); 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'). + body.append($('
'). append($('').addClass('shortcut_key').html(shortcuts[i].key)). append($('').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 diff --git a/IPython/frontend/html/notebook/static/tree/less/tree.less b/IPython/frontend/html/notebook/static/tree/less/tree.less index 33eb755..cdc2600 100644 --- a/IPython/frontend/html/notebook/static/tree/less/tree.less +++ b/IPython/frontend/html/notebook/static/tree/less/tree.less @@ -48,7 +48,6 @@ border: none; } - .list_item { &:hover .list_item { background-color: #ddd;