diff --git a/IPython/html/static/notebook/js/widgets/container.js b/IPython/html/static/notebook/js/widgets/container.js index 9db6b7a..a9919fa 100644 --- a/IPython/html/static/notebook/js/widgets/container.js +++ b/IPython/html/static/notebook/js/widgets/container.js @@ -73,14 +73,14 @@ define(["notebook/js/widget"], function(widget_manager) { this.$window = $('
') .addClass('modal widget-modal') .appendTo($('#notebook-container')); - var title_bar = $('') + this.$title_bar = $('') .addClass('popover-title') .appendTo(this.$window); var that = this; $('') .addClass('close') .html('×') - .appendTo(title_bar) + .appendTo(this.$title_bar) .click(function(){ that.hide(); event.stopPropagation(); @@ -88,7 +88,7 @@ define(["notebook/js/widget"], function(widget_manager) { this.$title = $('') .addClass('widget-modal-title') .html(' ') - .appendTo(title_bar); + .appendTo(this.$title_bar); this.$body = $('') .addClass('modal-body') .addClass('widget-container') @@ -104,6 +104,10 @@ define(["notebook/js/widget"], function(widget_manager) { this.$window.draggable({handle: '.popover-title', snap: '#notebook, .modal', snapMode: 'both'}); this.$window.resizable(); + this.$window.on('resize', function(){ + that.$body.outerHeight(that.$window.innerHeight() - that.$title_bar.outerHeight()); + }) + this._shown_once = false; },