Show More
@@ -10,14 +10,20 define([ | |||||
10 |
|
10 | |||
11 | var Page = function () { |
|
11 | var Page = function () { | |
12 | this.bind_events(); |
|
12 | this.bind_events(); | |
13 |
|
||||
14 | // When the page is ready, resize the header. |
|
|||
15 | var that = this; |
|
|||
16 | $(function() { that._resize_header(); }); |
|
|||
17 | }; |
|
13 | }; | |
18 |
|
14 | |||
19 | Page.prototype.bind_events = function () { |
|
15 | Page.prototype.bind_events = function () { | |
20 | events.on('resize-header.Page', $.proxy(this._resize_header, this)); |
|
16 | // resize site on: | |
|
17 | // - window resize | |||
|
18 | // - header change | |||
|
19 | // - page load | |||
|
20 | var _handle_resize = $.proxy(this._resize_site, this); | |||
|
21 | ||||
|
22 | $(window).resize(_handle_resize); | |||
|
23 | ||||
|
24 | // On document ready, resize codemirror. | |||
|
25 | $(document).ready(_handle_resize); | |||
|
26 | events.on('resize-header.Page', _handle_resize); | |||
21 | }; |
|
27 | }; | |
22 |
|
28 | |||
23 | Page.prototype.show = function () { |
|
29 | Page.prototype.show = function () { | |
@@ -44,12 +50,13 define([ | |||||
44 | * Main scripts should call this method after styling everything. |
|
50 | * Main scripts should call this method after styling everything. | |
45 | * TODO: selector are hardcoded, pass as constructor argument |
|
51 | * TODO: selector are hardcoded, pass as constructor argument | |
46 | */ |
|
52 | */ | |
47 | $('div#site').css('display','block'); |
|
53 | $('div#site').css('display', 'block'); | |
|
54 | this._resize_site(); | |||
48 | }; |
|
55 | }; | |
49 |
|
56 | |||
50 |
Page.prototype._resize_ |
|
57 | Page.prototype._resize_site = function() { | |
51 |
// Update the |
|
58 | // Update the site's size. | |
52 |
$(' |
|
59 | $('div#site').height(window.innerHeight - $('#header').height()); | |
53 | }; |
|
60 | }; | |
54 |
|
61 | |||
55 | // Register self in the global namespace for convenience. |
|
62 | // Register self in the global namespace for convenience. |
@@ -14,9 +14,6 body { | |||||
14 | right: 0px; |
|
14 | right: 0px; | |
15 | top: 0px; |
|
15 | top: 0px; | |
16 | bottom: 0px; |
|
16 | bottom: 0px; | |
17 | @media not print { |
|
|||
18 | .vbox(); |
|
|||
19 | } |
|
|||
20 | overflow: visible; |
|
17 | overflow: visible; | |
21 | } |
|
18 | } | |
22 |
|
19 | |||
@@ -85,10 +82,6 body { | |||||
85 | display: none; |
|
82 | display: none; | |
86 | .border-box-sizing(); |
|
83 | .border-box-sizing(); | |
87 | overflow: auto; |
|
84 | overflow: auto; | |
88 | @media not print { |
|
|||
89 | flex: 1; |
|
|||
90 | height: 0px; // triggers overflow, but overridded by flex |
|
|||
91 | } |
|
|||
92 | } |
|
85 | } | |
93 |
|
86 | |||
94 | /* Smaller buttons */ |
|
87 | /* Smaller buttons */ |
@@ -90,7 +90,7 require([ | |||||
90 | // height twice. Once for top padding and once for bottom padding. |
|
90 | // height twice. Once for top padding and once for bottom padding. | |
91 | $('div.CodeMirror').height(window.innerHeight - header.height() - 2*header_margin_bottom); |
|
91 | $('div.CodeMirror').height(window.innerHeight - header.height() - 2*header_margin_bottom); | |
92 | }; |
|
92 | }; | |
93 |
window. |
|
93 | $(window).resize(_handle_resize); | |
94 |
|
94 | |||
95 | // On document ready, resize codemirror. |
|
95 | // On document ready, resize codemirror. | |
96 | $(document).ready(_handle_resize); |
|
96 | $(document).ready(_handle_resize); |
@@ -8267,24 +8267,6 body { | |||||
8267 | bottom: 0px; |
|
8267 | bottom: 0px; | |
8268 | overflow: visible; |
|
8268 | overflow: visible; | |
8269 | } |
|
8269 | } | |
8270 | @media not print { |
|
|||
8271 | body { |
|
|||
8272 | /* Old browsers */ |
|
|||
8273 | display: -webkit-box; |
|
|||
8274 | -webkit-box-orient: vertical; |
|
|||
8275 | -webkit-box-align: stretch; |
|
|||
8276 | display: -moz-box; |
|
|||
8277 | -moz-box-orient: vertical; |
|
|||
8278 | -moz-box-align: stretch; |
|
|||
8279 | display: box; |
|
|||
8280 | box-orient: vertical; |
|
|||
8281 | box-align: stretch; |
|
|||
8282 | /* Modern browsers */ |
|
|||
8283 | display: flex; |
|
|||
8284 | flex-direction: column; |
|
|||
8285 | align-items: stretch; |
|
|||
8286 | } |
|
|||
8287 | } |
|
|||
8288 | #header { |
|
8270 | #header { | |
8289 | /* Initially hidden to prevent FLOUC */ |
|
8271 | /* Initially hidden to prevent FLOUC */ | |
8290 | display: none; |
|
8272 | display: none; | |
@@ -8349,12 +8331,6 body { | |||||
8349 | -webkit-box-sizing: border-box; |
|
8331 | -webkit-box-sizing: border-box; | |
8350 | overflow: auto; |
|
8332 | overflow: auto; | |
8351 | } |
|
8333 | } | |
8352 | @media not print { |
|
|||
8353 | #site { |
|
|||
8354 | flex: 1; |
|
|||
8355 | height: 0px; |
|
|||
8356 | } |
|
|||
8357 | } |
|
|||
8358 | /* Smaller buttons */ |
|
8334 | /* Smaller buttons */ | |
8359 | .ui-button .ui-button-text { |
|
8335 | .ui-button .ui-button-text { | |
8360 | padding: 0.2em 0.8em; |
|
8336 | padding: 0.2em 0.8em; |
General Comments 0
You need to be logged in to leave comments.
Login now