##// END OF EJS Templates
Address @carreau 's review comments
Jonathan Frederic -
Show More
@@ -20,8 +20,9 b' define(['
20 */
20 */
21 this.events = options.events;
21 this.events = options.events;
22 this.pager_element = $(pager_selector);
22 this.pager_element = $(pager_selector);
23 this.pager_button_area = $('#pager-button-area');
23 this.pager_button_area = $('#pager-button-area');
24 this.pager_element.resizable({handles: 'n'});
24 this._default_end_space = 200;
25 this.pager_element.resizable({handles: 'n', resize: $.proxy(this._resize, this)});
25 this.expanded = false;
26 this.expanded = false;
26 this.create_button_area();
27 this.create_button_area();
27 this.bind_events();
28 this.bind_events();
@@ -55,7 +56,10 b' define(['
55
56
56 this.pager_element.bind('collapse_pager', function (event, extrap) {
57 this.pager_element.bind('collapse_pager', function (event, extrap) {
57 // Animate hiding of the pager.
58 // Animate hiding of the pager.
58 that.pager_element.hide((extrap && extrap.duration) ? extrap.duration : 'fast');
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 this.pager_element.bind('expand_pager', function (event, extrap) {
65 this.pager_element.bind('expand_pager', function (event, extrap) {
@@ -69,6 +73,7 b' define(['
69 // Explicitly set pager height once the pager has shown itself.
73 // Explicitly set pager height once the pager has shown itself.
70 // This allows the pager-contents div to use percentage sizing.
74 // This allows the pager-contents div to use percentage sizing.
71 that.pager_element.height(that.pager_element.height());
75 that.pager_element.height(that.pager_element.height());
76 that._resize();
72 });
77 });
73 });
78 });
74
79
@@ -140,6 +145,18 b' define(['
140 this.pager_element.find(".container").append($('<pre/>').html(utils.fixCarriageReturn(utils.fixConsole(text))));
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 // Backwards compatability.
160 // Backwards compatability.
144 IPython.Pager = Pager;
161 IPython.Pager = Pager;
145
162
General Comments 0
You need to be logged in to leave comments. Login now