don't attempt to parse a non-existing widget area

v1.18.x
psychobunny 11 years ago
parent 58fe16e15c
commit bdc7a19bd7

@ -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) {
$('body [no-widget-class]').each(function() { if (!renderedWidgets.length) {
var $this = $(this); $('body [no-widget-class]').each(function() {
$this.removeClass(); var $this = $(this);
$this.addClass($this.attr('no-widget-class')); $this.removeClass();
}); $this.addClass($this.attr('no-widget-class'));
});
}
} }
checkCallback(); checkCallback();

Loading…
Cancel
Save