Show More
@@ -1,63 +1,61 | |||
|
1 | 1 | //---------------------------------------------------------------------------- |
|
2 |
// Copyright (C) 20 |
|
|
2 | // Copyright (C) 2011 The IPython Development Team | |
|
3 | 3 | // |
|
4 | 4 | // Distributed under the terms of the BSD License. The full license is in |
|
5 | 5 | // the file COPYING, distributed as part of this software. |
|
6 | 6 | //---------------------------------------------------------------------------- |
|
7 | 7 | |
|
8 | 8 | //============================================================================ |
|
9 | 9 | // Layout |
|
10 | 10 | //============================================================================ |
|
11 | 11 | |
|
12 | 12 | var IPython = (function (IPython) { |
|
13 | 13 | "use strict"; |
|
14 | 14 | |
|
15 | 15 | var LayoutManager = function () { |
|
16 | 16 | this.bind_events(); |
|
17 | 17 | }; |
|
18 | 18 | |
|
19 | ||
|
20 | 19 | LayoutManager.prototype.bind_events = function () { |
|
21 | 20 | $(window).resize($.proxy(this.do_resize,this)); |
|
22 | 21 | }; |
|
23 | 22 | |
|
24 | 23 | LayoutManager.prototype.app_height = function() { |
|
25 | 24 | var win = $(window); |
|
26 | 25 | var w = win.width(); |
|
27 | 26 | var h = win.height(); |
|
28 | 27 | var header_height; |
|
29 | 28 | if ($('div#header').css('display') === 'none') { |
|
30 | 29 | header_height = 0; |
|
31 | 30 | } else { |
|
32 | 31 | header_height = $('div#header').outerHeight(true); |
|
33 | 32 | } |
|
34 | var menubar_height = $('div#menubar').outerHeight(true); | |
|
35 | var toolbar_height; | |
|
36 | if ($('div#maintoolbar').css('display') === 'none') { | |
|
37 | toolbar_height = 0; | |
|
33 | var menubar_height; | |
|
34 | if ($('div#menubar-container').css('display') === 'none') { | |
|
35 | menubar_height = 0; | |
|
38 | 36 | } else { |
|
39 |
|
|
|
37 | menubar_height = $('div#menubar-container').outerHeight(true); | |
|
40 | 38 | } |
|
41 |
return h-header_height-menubar_height |
|
|
42 | } | |
|
39 | return h-header_height-menubar_height; // content height | |
|
40 | }; | |
|
43 | 41 | |
|
44 | 42 | LayoutManager.prototype.do_resize = function () { |
|
45 | var app_height = this.app_height() // content height | |
|
43 | var app_height = this.app_height(); // content height | |
|
46 | 44 | |
|
47 | 45 | $('#ipython-main-app').height(app_height); // content+padding+border height |
|
48 | 46 | |
|
49 | 47 | var pager_height = IPython.pager.percentage_height*app_height; |
|
50 | 48 | var pager_splitter_height = $('div#pager_splitter').outerHeight(true); |
|
51 | 49 | $('div#pager').outerHeight(pager_height); |
|
52 | 50 | if (IPython.pager.expanded) { |
|
53 | 51 | $('div#notebook').outerHeight(app_height-pager_height-pager_splitter_height); |
|
54 | 52 | } else { |
|
55 | 53 | $('div#notebook').outerHeight(app_height-pager_splitter_height); |
|
56 | 54 | } |
|
57 | 55 | }; |
|
58 | 56 | |
|
59 | 57 | IPython.LayoutManager = LayoutManager; |
|
60 | 58 | |
|
61 | 59 | return IPython; |
|
62 | 60 | |
|
63 | 61 | }(IPython)); |
General Comments 0
You need to be logged in to leave comments.
Login now