From ccd2da3b9b16e771ebdca216db6a737f869543d6 2015-01-21 21:19:52 From: Jonathan Frederic Date: 2015-01-21 21:19:52 Subject: [PATCH] Explicitly size codemirror editor in Edit app --- diff --git a/IPython/html/static/edit/js/main.js b/IPython/html/static/edit/js/main.js index 898dd19..2dfc0c4 100644 --- a/IPython/html/static/edit/js/main.js +++ b/IPython/html/static/edit/js/main.js @@ -2,6 +2,7 @@ // Distributed under the terms of the Modified BSD License. require([ + 'jquery', 'base/js/namespace', 'base/js/utils', 'base/js/page', @@ -14,6 +15,7 @@ require([ 'edit/js/notificationarea', 'custom/custom', ], function( + $, IPython, utils, page, @@ -75,4 +77,14 @@ require([ } }; + // Make sure the codemirror editor is sized appropriatley. + var _handle_resize = function() { + var header = $('#header'); + var padding = header.outerHeight(true) - header.innerHeight(); + $('div.CodeMirror').height(window.innerHeight - header.height() - 2*padding); + }; + window.onresize = _handle_resize; + + // On document ready, resize codemirror. + $(_handle_resize); });