mirror of
https://github.com/jupyter/notebook.git
synced 2024-12-21 04:10:17 +08:00
Center modal view on show
This commit is contained in:
parent
2d536f64f5
commit
8b08e1c53c
@ -120,9 +120,10 @@ define(["notebook/js/widget"], function(widget_manager) {
|
||||
show: function() {
|
||||
this.$window.show();
|
||||
this.$show_button.addClass('btn-info');
|
||||
var position = this.$show_button.offset();
|
||||
this.$window.css('left', position.left + this.$show_button.outerWidth());
|
||||
this.$window.css('top', position.top);
|
||||
this.$window.css("top", Math.max(0, (($(window).height() - this.$window.outerHeight()) / 2) +
|
||||
$(window).scrollTop()) + "px");
|
||||
this.$window.css("left", Math.max(0, (($(window).width() - this.$window.outerWidth()) / 2) +
|
||||
$(window).scrollLeft()) + "px");
|
||||
},
|
||||
|
||||
update: function(){
|
||||
|
Loading…
Reference in New Issue
Block a user