Show More
@@ -65,10 +65,7 b' IPython.dialog = (function (IPython) {' | |||||
65 | }); |
|
65 | }); | |
66 | } |
|
66 | } | |
67 |
|
67 | |||
68 | dialog.modal(options); |
|
68 | return dialog.modal(options); | |
69 | // setTimeout(function() { |
|
|||
70 | // footer.find("button").last().focus() |
|
|||
71 | // }, 0); |
|
|||
72 | } |
|
69 | } | |
73 |
|
70 | |||
74 | return { |
|
71 | return { |
@@ -19,12 +19,11 b' var IPython = (function (IPython) {' | |||||
19 | var that = this; |
|
19 | var that = this; | |
20 | if ( this.shortcut_dialog ){ |
|
20 | if ( this.shortcut_dialog ){ | |
21 | // if dialog is already shown, close it |
|
21 | // if dialog is already shown, close it | |
22 |
this.shortcut_dialog. |
|
22 | this.shortcut_dialog.find("button").first().click(); | |
23 | this.shortcut_dialog = null; |
|
23 | this.shortcut_dialog = null; | |
24 | return; |
|
24 | return; | |
25 | } |
|
25 | } | |
26 |
var |
|
26 | var body = $('<div/>'); | |
27 | this.shortcut_dialog = dialog; |
|
|||
28 | var shortcuts = [ |
|
27 | var shortcuts = [ | |
29 | {key: 'Shift-Enter', help: 'run cell'}, |
|
28 | {key: 'Shift-Enter', help: 'run cell'}, | |
30 | {key: 'Ctrl-Enter', help: 'run cell in-place'}, |
|
29 | {key: 'Ctrl-Enter', help: 'run cell in-place'}, | |
@@ -53,16 +52,19 b' var IPython = (function (IPython) {' | |||||
53 | {key: 'Ctrl-m h', help: 'show keyboard shortcuts'} |
|
52 | {key: 'Ctrl-m h', help: 'show keyboard shortcuts'} | |
54 | ]; |
|
53 | ]; | |
55 | for (var i=0; i<shortcuts.length; i++) { |
|
54 | for (var i=0; i<shortcuts.length; i++) { | |
56 |
|
|
55 | body.append($('<div>'). | |
57 | append($('<span/>').addClass('shortcut_key').html(shortcuts[i].key)). |
|
56 | append($('<span/>').addClass('shortcut_key').html(shortcuts[i].key)). | |
58 | append($('<span/>').addClass('shortcut_descr').html(' : ' + shortcuts[i].help)) |
|
57 | append($('<span/>').addClass('shortcut_descr').html(' : ' + shortcuts[i].help)) | |
59 | ); |
|
58 | ); | |
60 | }; |
|
59 | }; | |
61 | dialog.bind('dialogclose', function(event) { |
|
60 | this.shortcut_dialog = IPython.dialog.modal({ | |
62 | // dialog has been closed, allow it to be drawn again. |
|
61 | title : "Keyboard shortcuts", | |
63 | that.shortcut_dialog = null; |
|
62 | body : body, | |
|
63 | buttons : { | |||
|
64 | Close : {} | |||
|
65 | } | |||
64 | }); |
|
66 | }); | |
65 | dialog.dialog({title: 'Keyboard shortcuts', closeText: ''}); |
|
67 | console.log(dialog); | |
66 | }; |
|
68 | }; | |
67 |
|
69 | |||
68 | // Set module variables |
|
70 | // Set module variables |
General Comments 0
You need to be logged in to leave comments.
Login now