global header widgets

v1.18.x
psychobunny 11 years ago
parent 351e376812
commit bfa3b0f22f

@ -15,7 +15,7 @@
}; };
ajaxify.widgets.render = function(tpl_url, url, callback) { ajaxify.widgets.render = function(tpl_url, url, callback) {
var widgetLocations = ['sidebar', 'footer'], numLocations; var widgetLocations = ['sidebar', 'footer', 'header'], numLocations;
$('#content [widget-area]').each(function() { $('#content [widget-area]').each(function() {
var location = $(this).attr('widget-area'); var location = $(this).attr('widget-area');
@ -48,6 +48,8 @@
} else if (location === 'sidebar') { } else if (location === 'sidebar') {
$('#content > *').wrapAll($('<div class="col-lg-9 col-xs-12"></div>')); $('#content > *').wrapAll($('<div class="col-lg-9 col-xs-12"></div>'));
$('#content').append($('<div class="col-lg-3 col-xs-12"><div widget-area="sidebar"></div></div>')); $('#content').append($('<div class="col-lg-3 col-xs-12"><div widget-area="sidebar"></div></div>'));
} else if (location === 'header') {
$('#content').prepend($('<div class="col-xs-12"><div widget-area="header"></div></div>'));
} }
area = $('#content [widget-area="' + location + '"]'); area = $('#content [widget-area="' + location + '"]');

@ -112,6 +112,7 @@ adminController.themes.get = function(req, res, next) {
areas: function(next) { areas: function(next) {
var defaultAreas = [ var defaultAreas = [
{ name: 'Global Sidebar', template: 'global', location: 'sidebar' }, { name: 'Global Sidebar', template: 'global', location: 'sidebar' },
{ name: 'Global Header', template: 'global', location: 'header' },
{ name: 'Global Footer', template: 'global', location: 'footer' }, { name: 'Global Footer', template: 'global', location: 'footer' },
]; ];

@ -81,6 +81,7 @@ var async = require('async'),
Widgets.reset = function(callback) { Widgets.reset = function(callback) {
var defaultAreas = [ var defaultAreas = [
{ name: 'Global Sidebar', template: 'global', location: 'sidebar' }, { name: 'Global Sidebar', template: 'global', location: 'sidebar' },
{ name: 'Global Header', template: 'global', location: 'header' },
{ name: 'Draft Zone', template: 'global', location: 'drafts' } { name: 'Draft Zone', template: 'global', location: 'drafts' }
]; ];

Loading…
Cancel
Save