mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-05-25 20:44:53 -04:00
33 lines
707 B
JavaScript
33 lines
707 B
JavaScript
|
|
modulejs.define('view/spacing', ['_', '$', 'core/settings', 'core/event'], function (_, $, allsettings, event) {
|
|
|
|
var settings = _.extend({
|
|
maxWidth: 960,
|
|
top: 50,
|
|
right: "auto",
|
|
bottom: 50,
|
|
left: "auto"
|
|
}, 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();
|
|
});
|