page.js
45 lines
| 1.3 KiB
| application/javascript
|
JavascriptLexer
Jonathan Frederic
|
r17188 | // Copyright (c) IPython Development Team. | ||
// Distributed under the terms of the Modified BSD License. | ||||
define([ | ||||
'base/js/namespace', | ||||
Jonathan Frederic
|
r17200 | 'jquery', | ||
Jonathan Frederic
|
r17188 | ], function(IPython, $){ | ||
Matthias BUSSONNIER
|
r12103 | "use strict"; | ||
Brian Granger
|
r6192 | |||
var Page = function () { | ||||
this.style(); | ||||
this.bind_events(); | ||||
}; | ||||
Page.prototype.style = function () { | ||||
MinRK
|
r10906 | $('div#header').addClass('border-box-sizing'); | ||
$('div#site').addClass('border-box-sizing'); | ||||
Brian Granger
|
r6192 | }; | ||
Page.prototype.bind_events = function () { | ||||
}; | ||||
Page.prototype.show = function () { | ||||
// The header and site divs start out hidden to prevent FLOUC. | ||||
// Main scripts should call this method after styling everything. | ||||
Brian Granger
|
r6193 | this.show_header(); | ||
this.show_site(); | ||||
}; | ||||
Page.prototype.show_header = function () { | ||||
// The header and site divs start out hidden to prevent FLOUC. | ||||
// Main scripts should call this method after styling everything. | ||||
Brian Granger
|
r6192 | $('div#header').css('display','block'); | ||
Brian Granger
|
r6193 | }; | ||
Page.prototype.show_site = function () { | ||||
// The header and site divs start out hidden to prevent FLOUC. | ||||
// Main scripts should call this method after styling everything. | ||||
Brian Granger
|
r6192 | $('div#site').css('display','block'); | ||
}; | ||||
Jonathan Frederic
|
r17188 | // Register self in the global namespace for convenience. | ||
Brian Granger
|
r6192 | IPython.Page = Page; | ||
Jonathan Frederic
|
r17201 | return {'Page': Page}; | ||
Jonathan Frederic
|
r17188 | }); | ||