mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-08 15:05:46 +01:00
don't attempt to parse a non-existing widget area
This commit is contained in:
@@ -166,16 +166,18 @@ var ajaxify = {};
|
|||||||
numLocations = widgetLocations.length;
|
numLocations = widgetLocations.length;
|
||||||
|
|
||||||
function renderWidget(err, renderedWidgets) {
|
function renderWidget(err, renderedWidgets) {
|
||||||
area.html(templates.prepare(area.html()).parse({
|
if (area.html()) {
|
||||||
widgets: renderedWidgets
|
area.html(templates.prepare(area.html()).parse({
|
||||||
})).removeClass('hidden');
|
widgets: renderedWidgets
|
||||||
|
})).removeClass('hidden');
|
||||||
|
|
||||||
if (!renderedWidgets.length) {
|
if (!renderedWidgets.length) {
|
||||||
$('body [no-widget-class]').each(function() {
|
$('body [no-widget-class]').each(function() {
|
||||||
var $this = $(this);
|
var $this = $(this);
|
||||||
$this.removeClass();
|
$this.removeClass();
|
||||||
$this.addClass($this.attr('no-widget-class'));
|
$this.addClass($this.attr('no-widget-class'));
|
||||||
});
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
checkCallback();
|
checkCallback();
|
||||||
|
|||||||
Reference in New Issue
Block a user