diff --git a/IPython/frontend/html/notebook/static/js/notebook.js b/IPython/frontend/html/notebook/static/js/notebook.js
index b4328ed..fb6cdf8 100644
--- a/IPython/frontend/html/notebook/static/js/notebook.js
+++ b/IPython/frontend/html/notebook/static/js/notebook.js
@@ -136,6 +136,7 @@ var IPython = (function (IPython) {
} else if (event.which === key.ESC) {
// Intercept escape at highest level to avoid closing
// websocket connection with firefox
+ IPython.pager.collapse();
event.preventDefault();
} else if (event.which === key.SHIFT) {
// ignore shift keydown
diff --git a/IPython/frontend/html/notebook/static/js/pager.js b/IPython/frontend/html/notebook/static/js/pager.js
index 1b0e076..d67de97 100644
--- a/IPython/frontend/html/notebook/static/js/pager.js
+++ b/IPython/frontend/html/notebook/static/js/pager.js
@@ -48,14 +48,24 @@ var IPython = (function (IPython) {
var that = this;
this.pager_button_area.append(
$('').attr('role', "button")
- .attr('title',"open the pager in an external window")
+ .attr('title',"Open the pager in an external window")
.addClass('ui-button')
.click(function(){that.detach()})
- .attr('style','position: absolute; right: 10px;')
+ .attr('style','position: absolute; right: 20px;')
.append(
$('').addClass("ui-icon ui-icon-extlink")
)
)
+ this.pager_button_area.append(
+ $('').attr('role', "button")
+ .attr('title',"Close the pager")
+ .addClass('ui-button')
+ .click(function(){that.collapse()})
+ .attr('style','position: absolute; right: 5px;')
+ .append(
+ $('').addClass("ui-icon ui-icon-close")
+ )
+ )
};
Pager.prototype.style = function () {