mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-05-28 14:04:45 -04:00
Refactored and lots of modification. See README.md.
This commit is contained in:
parent
859a680e19
commit
71ed41fa69
85 changed files with 3191 additions and 2969 deletions
35
src/_h5ai/js/inc/view/spacing.js
Normal file
35
src/_h5ai/js/inc/view/spacing.js
Normal file
|
@ -0,0 +1,35 @@
|
|||
|
||||
module.define('view/spacing', [jQuery, 'core/settings', 'core/event'], function ($, allsettings, event) {
|
||||
|
||||
var defaults = {
|
||||
maxWidth: 960,
|
||||
top: 50,
|
||||
right: "auto",
|
||||
bottom: 50,
|
||||
left: "auto"
|
||||
},
|
||||
|
||||
settings = _.extend({}, defaults, allsettings.spacing),
|
||||
|
||||
adjustSpacing = function () {
|
||||
|
||||
$('#content').css({
|
||||
'margin-top': settings.top + $('#topbar').outerHeight(),
|
||||
'margin-bottom': settings.bottom + $('#bottombar').outerHeight()
|
||||
});
|
||||
},
|
||||
|
||||
init = function () {
|
||||
|
||||
$('#content').css({
|
||||
'max-width': settings.maxWidth,
|
||||
'margin-right': settings.right,
|
||||
'margin-left': settings.left
|
||||
});
|
||||
|
||||
event.sub('ready', adjustSpacing);
|
||||
$(window).on('resize', adjustSpacing);
|
||||
};
|
||||
|
||||
init();
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue