rebuild.QuickHelp event sets the dirty bit

QuickHelp is rebuilt on show if the dirty bit was set.
pull/37/head
Paul Ivanov 12 years ago
parent cdb7967cc2
commit 8bf4ffa2ca

@ -189,7 +189,7 @@ IPython.keyboard = (function (IPython) {
this._shortcuts[shortcut] = data;
if (!suppress_help_update) {
// update the keyboard shortcuts notebook help
IPython.quick_help = new IPython.QuickHelp();
$([IPython.events]).trigger('rebuild.QuickHelp')
}
}
@ -209,7 +209,7 @@ IPython.keyboard = (function (IPython) {
IPython.quick_help = new IPython.QuickHelp();
if (!suppress_help_update) {
// update the keyboard shortcuts notebook help
IPython.quick_help = new IPython.QuickHelp();
$([IPython.events]).trigger('rebuild.QuickHelp');
}
}

@ -18,6 +18,10 @@ var IPython = (function (IPython) {
QuickHelp.prototype.show_keyboard_shortcuts = function () {
// toggles display of keyboard shortcut dialog
var that = this;
if ( this.force_rebuild ) {
delete(this.shortcut_dialog);
this.force_rebuild = false;
}
if ( this.shortcut_dialog ){
// if dialog is already shown, close it
$(this.shortcut_dialog).modal("toggle");
@ -57,6 +61,8 @@ var IPython = (function (IPython) {
Close : {}
}
});
$([IPython.events]).on('rebuild.QuickHelp', function() { that.force_rebuild = true;});
};
QuickHelp.prototype.build_command_help = function () {

Loading…
Cancel
Save