Show More
@@ -10,14 +10,20 b' define([' | |||
|
10 | 10 | |
|
11 | 11 | var Page = function () { |
|
12 | 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 | 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 | 29 | Page.prototype.show = function () { |
@@ -44,12 +50,13 b' define([' | |||
|
44 | 50 | * Main scripts should call this method after styling everything. |
|
45 | 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_ |
|
|
51 |
// Update the |
|
|
52 |
$(' |
|
|
57 | Page.prototype._resize_site = function() { | |
|
58 | // Update the site's size. | |
|
59 | $('div#site').height(window.innerHeight - $('#header').height()); | |
|
53 | 60 | }; |
|
54 | 61 | |
|
55 | 62 | // Register self in the global namespace for convenience. |
@@ -14,9 +14,6 b' body {' | |||
|
14 | 14 | right: 0px; |
|
15 | 15 | top: 0px; |
|
16 | 16 | bottom: 0px; |
|
17 | @media not print { | |
|
18 | .vbox(); | |
|
19 | } | |
|
20 | 17 | overflow: visible; |
|
21 | 18 | } |
|
22 | 19 | |
@@ -81,14 +78,16 b' body {' | |||
|
81 | 78 | } |
|
82 | 79 | |
|
83 | 80 | #site { |
|
81 | // avoid repaints on size with translateZ(0) | |
|
82 | -webkit-transform: translateZ(0); | |
|
83 | -moz-transform: translateZ(0); | |
|
84 | -ms-transform: translateZ(0); | |
|
85 | -o-transform: translateZ(0); | |
|
86 | transform: translateZ(0); | |
|
84 | 87 | width: 100%; |
|
85 | 88 | display: none; |
|
86 | 89 | .border-box-sizing(); |
|
87 | 90 | overflow: auto; |
|
88 | @media not print { | |
|
89 | flex: 1; | |
|
90 | height: 0px; // triggers overflow, but overridded by flex | |
|
91 | } | |
|
92 | 91 | } |
|
93 | 92 | |
|
94 | 93 | /* Smaller buttons */ |
@@ -90,7 +90,7 b' require([' | |||
|
90 | 90 | // height twice. Once for top padding and once for bottom padding. |
|
91 | 91 | $('div.CodeMirror').height(window.innerHeight - header.height() - 2*header_margin_bottom); |
|
92 | 92 | }; |
|
93 |
window. |
|
|
93 | $(window).resize(_handle_resize); | |
|
94 | 94 | |
|
95 | 95 | // On document ready, resize codemirror. |
|
96 | 96 | $(document).ready(_handle_resize); |
@@ -8,7 +8,7 b" define(['jquery'], function($){" | |||
|
8 | 8 | * Public constructor. |
|
9 | 9 | */ |
|
10 | 10 | this.notebook = notebook; |
|
11 |
this.element = $(' |
|
|
11 | this.element = $('#site'); | |
|
12 | 12 | options = options || {}; |
|
13 | 13 | this.animation_speed = options.animation_speed || 250; //ms |
|
14 | 14 | }; |
@@ -5,7 +5,7 b'' | |||
|
5 | 5 | .navbar { |
|
6 | 6 | border-top: 1px; |
|
7 | 7 | border-radius: 0px 0px @border-radius-base @border-radius-base; |
|
8 |
margin-bottom: |
|
|
8 | margin-bottom: 0px; | |
|
9 | 9 | } |
|
10 | 10 | |
|
11 | 11 | .navbar-toggle { |
@@ -8267,24 +8267,6 b' body {' | |||
|
8267 | 8267 | bottom: 0px; |
|
8268 | 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 | 8270 | #header { |
|
8289 | 8271 | /* Initially hidden to prevent FLOUC */ |
|
8290 | 8272 | display: none; |
@@ -8342,6 +8324,11 b' body {' | |||
|
8342 | 8324 | height: 28px; |
|
8343 | 8325 | } |
|
8344 | 8326 | #site { |
|
8327 | -webkit-transform: translateZ(0); | |
|
8328 | -moz-transform: translateZ(0); | |
|
8329 | -ms-transform: translateZ(0); | |
|
8330 | -o-transform: translateZ(0); | |
|
8331 | transform: translateZ(0); | |
|
8345 | 8332 | width: 100%; |
|
8346 | 8333 | display: none; |
|
8347 | 8334 | box-sizing: border-box; |
@@ -8349,12 +8336,6 b' body {' | |||
|
8349 | 8336 | -webkit-box-sizing: border-box; |
|
8350 | 8337 | overflow: auto; |
|
8351 | 8338 | } |
|
8352 | @media not print { | |
|
8353 | #site { | |
|
8354 | flex: 1; | |
|
8355 | height: 0px; | |
|
8356 | } | |
|
8357 | } | |
|
8358 | 8339 | /* Smaller buttons */ |
|
8359 | 8340 | .ui-button .ui-button-text { |
|
8360 | 8341 | padding: 0.2em 0.8em; |
@@ -10340,7 +10321,7 b' select[multiple].celltoolbar select {' | |||
|
10340 | 10321 | #menubar .navbar { |
|
10341 | 10322 | border-top: 1px; |
|
10342 | 10323 | border-radius: 0px 0px 2px 2px; |
|
10343 |
margin-bottom: |
|
|
10324 | margin-bottom: 0px; | |
|
10344 | 10325 | } |
|
10345 | 10326 | #menubar .navbar-toggle { |
|
10346 | 10327 | float: left; |
General Comments 0
You need to be logged in to leave comments.
Login now