mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-04 21:15:55 +01:00
fixed positioning if no sidebar widget selected
This commit is contained in:
@@ -30,17 +30,6 @@
|
||||
function renderWidgets(location) {
|
||||
var area = $('#content [widget-area="' + location + '"]');
|
||||
|
||||
if (!area.length && window.location.pathname.indexOf('/admin') === -1) {
|
||||
if (location === 'footer') {
|
||||
$('#content').append($('<div class="col-xs-12"><div widget-area="footer"></div></div>'));
|
||||
} else if (location === 'sidebar') {
|
||||
$('#content > *').wrapAll($('<div class="col-xs-9"></div>'));
|
||||
$('#content').append($('<div class="col-xs-3"><div widget-area="sidebar"></div></div>'));
|
||||
}
|
||||
|
||||
area = $('#content [widget-area="' + location + '"]');
|
||||
}
|
||||
|
||||
socket.emit('widgets.render', {template: tpl_url + '.tpl', url: url, location: location}, function(err, renderedWidgets) {
|
||||
var html = '';
|
||||
|
||||
@@ -50,6 +39,17 @@
|
||||
}
|
||||
}
|
||||
|
||||
if (!area.length && window.location.pathname.indexOf('/admin') === -1 && renderedWidgets.length) {
|
||||
if (location === 'footer') {
|
||||
$('#content').append($('<div class="col-xs-12"><div widget-area="footer"></div></div>'));
|
||||
} else if (location === 'sidebar') {
|
||||
$('#content > *').wrapAll($('<div class="col-xs-9"></div>'));
|
||||
$('#content').append($('<div class="col-xs-3"><div widget-area="sidebar"></div></div>'));
|
||||
}
|
||||
|
||||
area = $('#content [widget-area="' + location + '"]');
|
||||
}
|
||||
|
||||
area.html(html).removeClass('hidden');
|
||||
|
||||
if (!renderedWidgets.length) {
|
||||
|
||||
Reference in New Issue
Block a user