From 1516c1fc78e0cd5464a32ea95c47097953cf567c 2014-03-09 19:24:32 From: Paul Ivanov Date: 2014-03-09 19:24:32 Subject: [PATCH] update notebook quickhelp on new shortcuts --- diff --git a/IPython/html/static/base/js/keyboard.js b/IPython/html/static/base/js/keyboard.js index 20e38ba..c204afa 100644 --- a/IPython/html/static/base/js/keyboard.js +++ b/IPython/html/static/base/js/keyboard.js @@ -174,7 +174,7 @@ IPython.keyboard = (function (IPython) { this._shortcuts = {}; } - ShortcutManager.prototype.add_shortcut = function (shortcut, data) { + ShortcutManager.prototype.add_shortcut = function (shortcut, data, suppress_help_update) { if (typeof(data) === 'function') { data = {help: '', help_index: '', handler: data} } @@ -187,12 +187,18 @@ IPython.keyboard = (function (IPython) { shortcut = normalize_shortcut(shortcut); this._counts[shortcut] = 0; this._shortcuts[shortcut] = data; + if (!suppress_help_update) { + // update the keyboard shortcuts notebook help + IPython.quick_help = new IPython.QuickHelp(); + } } ShortcutManager.prototype.add_shortcuts = function (data) { for (var shortcut in data) { - this.add_shortcut(shortcut, data[shortcut]); + this.add_shortcut(shortcut, data[shortcut], True); } + // update the keyboard shortcuts notebook help + IPython.quick_help = new IPython.QuickHelp(); } ShortcutManager.prototype.remove_shortcut = function (shortcut) {