From 0aa0fff062c8e17136d34c62c8bf33b956e5a29c 2014-12-05 01:11:24 From: Jonathan Frederic <jdfreder@calpoly.edu> Date: 2014-12-05 01:11:24 Subject: [PATCH] Address @carreau 's review comments --- diff --git a/IPython/html/static/notebook/js/pager.js b/IPython/html/static/notebook/js/pager.js index ee4d523..aa372d7 100644 --- a/IPython/html/static/notebook/js/pager.js +++ b/IPython/html/static/notebook/js/pager.js @@ -20,8 +20,9 @@ define([ */ this.events = options.events; this.pager_element = $(pager_selector); - this.pager_button_area = $('#pager-button-area'); - this.pager_element.resizable({handles: 'n'}); + this.pager_button_area = $('#pager-button-area'); + this._default_end_space = 200; + this.pager_element.resizable({handles: 'n', resize: $.proxy(this._resize, this)}); this.expanded = false; this.create_button_area(); this.bind_events(); @@ -55,7 +56,10 @@ define([ this.pager_element.bind('collapse_pager', function (event, extrap) { // Animate hiding of the pager. - that.pager_element.hide((extrap && extrap.duration) ? extrap.duration : 'fast'); + var time = (extrap && extrap.duration) ? extrap.duration : 'fast'; + that.pager_element.hide(time, function() { + $('.end_space').css('height', that._default_end_space); + }); }); this.pager_element.bind('expand_pager', function (event, extrap) { @@ -69,6 +73,7 @@ define([ // Explicitly set pager height once the pager has shown itself. // This allows the pager-contents div to use percentage sizing. that.pager_element.height(that.pager_element.height()); + that._resize(); }); }); @@ -140,6 +145,18 @@ define([ this.pager_element.find(".container").append($('<pre/>').html(utils.fixCarriageReturn(utils.fixConsole(text)))); }; + + Pager.prototype._resize = function() { + /** + * Update document based on pager size. + */ + + // Make sure the padding at the end of the notebook is large + // enough that the user can scroll to the bottom of the + // notebook. + $('.end_space').css('height', Math.max(this.pager_element.height(), this._default_end_space)); + }; + // Backwards compatability. IPython.Pager = Pager;