Show More
@@ -20,8 +20,9 define([ | |||
|
20 | 20 | */ |
|
21 | 21 | this.events = options.events; |
|
22 | 22 | this.pager_element = $(pager_selector); |
|
23 |
this.pager_button_area = $('#pager-button-area'); |
|
|
24 | this.pager_element.resizable({handles: 'n'}); | |
|
23 | this.pager_button_area = $('#pager-button-area'); | |
|
24 | this._default_end_space = 200; | |
|
25 | this.pager_element.resizable({handles: 'n', resize: $.proxy(this._resize, this)}); | |
|
25 | 26 | this.expanded = false; |
|
26 | 27 | this.create_button_area(); |
|
27 | 28 | this.bind_events(); |
@@ -55,7 +56,10 define([ | |||
|
55 | 56 | |
|
56 | 57 | this.pager_element.bind('collapse_pager', function (event, extrap) { |
|
57 | 58 | // Animate hiding of the pager. |
|
58 |
|
|
|
59 | var time = (extrap && extrap.duration) ? extrap.duration : 'fast'; | |
|
60 | that.pager_element.hide(time, function() { | |
|
61 | $('.end_space').css('height', that._default_end_space); | |
|
62 | }); | |
|
59 | 63 | }); |
|
60 | 64 | |
|
61 | 65 | this.pager_element.bind('expand_pager', function (event, extrap) { |
@@ -69,6 +73,7 define([ | |||
|
69 | 73 | // Explicitly set pager height once the pager has shown itself. |
|
70 | 74 | // This allows the pager-contents div to use percentage sizing. |
|
71 | 75 | that.pager_element.height(that.pager_element.height()); |
|
76 | that._resize(); | |
|
72 | 77 | }); |
|
73 | 78 | }); |
|
74 | 79 | |
@@ -140,6 +145,18 define([ | |||
|
140 | 145 | this.pager_element.find(".container").append($('<pre/>').html(utils.fixCarriageReturn(utils.fixConsole(text)))); |
|
141 | 146 | }; |
|
142 | 147 | |
|
148 | ||
|
149 | Pager.prototype._resize = function() { | |
|
150 | /** | |
|
151 | * Update document based on pager size. | |
|
152 | */ | |
|
153 | ||
|
154 | // Make sure the padding at the end of the notebook is large | |
|
155 | // enough that the user can scroll to the bottom of the | |
|
156 | // notebook. | |
|
157 | $('.end_space').css('height', Math.max(this.pager_element.height(), this._default_end_space)); | |
|
158 | }; | |
|
159 | ||
|
143 | 160 | // Backwards compatability. |
|
144 | 161 | IPython.Pager = Pager; |
|
145 | 162 |
General Comments 0
You need to be logged in to leave comments.
Login now