From feffa597c5989f9b60659029504ebe9f4e15a7f6 2011-10-17 21:58:08
From: MinRK <benjaminrk@gmail.com>
Date: 2011-10-17 21:58:08
Subject: [PATCH] fix quickhelp widget

Move header.js -> quickhelp.js, as it not longer acts on whole header.
---

diff --git a/IPython/frontend/html/notebook/static/js/notebook_main.js b/IPython/frontend/html/notebook/static/js/notebook_main.js
index d4e6ea6..095d098 100644
--- a/IPython/frontend/html/notebook/static/js/notebook_main.js
+++ b/IPython/frontend/html/notebook/static/js/notebook_main.js
@@ -32,6 +32,7 @@ $(document).ready(function () {
     IPython.pager = new IPython.Pager('div#pager', 'div#pager_splitter');
     IPython.left_panel = new IPython.LeftPanel('div#left_panel', 'div#left_panel_splitter');
     IPython.save_widget = new IPython.SaveWidget('span#save_widget');
+    IPython.quick_help = new IPython.QuickHelp('span#quick_help_area');
     IPython.print_widget = new IPython.PrintWidget('span#print_widget');
     IPython.notebook = new IPython.Notebook('div#notebook');
     IPython.kernel_status_widget = new IPython.KernelStatusWidget('#kernel_status');
diff --git a/IPython/frontend/html/notebook/static/js/header.js b/IPython/frontend/html/notebook/static/js/quickhelp.js
similarity index 75%
rename from IPython/frontend/html/notebook/static/js/header.js
rename to IPython/frontend/html/notebook/static/js/quickhelp.js
index a808af8..b0682c0 100644
--- a/IPython/frontend/html/notebook/static/js/header.js
+++ b/IPython/frontend/html/notebook/static/js/quickhelp.js
@@ -6,35 +6,33 @@
 //----------------------------------------------------------------------------
 
 //============================================================================
-// HeaderSection
+// QuickHelp button
 //============================================================================
 
 var IPython = (function (IPython) {
 
-    var HeaderSection = function (selector) {
+    var QuickHelp = function (selector) {
         this.selector = selector;
         if (this.selector !== undefined) {
             this.element = $(selector);
-            this.content = this.element.find('div.header');
             this.style();
             this.bind_events();
         }
     };
 
-    HeaderSection.prototype.style = function () {
-        this.content.addClass('ui-helper-clearfix');
-        this.content.find('#quick_help').button();
+    QuickHelp.prototype.style = function () {
+        this.element.find('button#quick_help').button();
     };
 
-    HeaderSection.prototype.bind_events = function () {
+    QuickHelp.prototype.bind_events = function () {
         var that = this;
-        this.content.find('#quick_help').click(function () {
+        this.element.find("button#quick_help").click(function () {
             IPython.notebook.show_keyboard_shortcuts();
         });
     };
 
     // Set module variables
-    IPython.HeaderSection = HeaderSection;
+    IPython.QuickHelp = QuickHelp;
 
     return IPython;
 
diff --git a/IPython/frontend/html/notebook/templates/notebook.html b/IPython/frontend/html/notebook/templates/notebook.html
index ffb32c6..6fa05c5 100644
--- a/IPython/frontend/html/notebook/templates/notebook.html
+++ b/IPython/frontend/html/notebook/templates/notebook.html
@@ -266,7 +266,7 @@
 <script src="static/js/kernelstatus.js" type="text/javascript" charset="utf-8"></script>
 <script src="static/js/layout.js" type="text/javascript" charset="utf-8"></script>
 <script src="static/js/savewidget.js" type="text/javascript" charset="utf-8"></script>
-<script src="static/js/header.js" type="text/javascript" charset="utf-8"></script>
+<script src="static/js/quickhelp.js" type="text/javascript" charset="utf-8"></script>
 <script src="static/js/pager.js" type="text/javascript" charset="utf-8"></script>
 <script src="static/js/panelsection.js" type="text/javascript" charset="utf-8"></script>
 <script src="static/js/printwidget.js" type="text/javascript" charset="utf-8"></script>