v1.18.x
psychobunny 11 years ago
parent 1804373322
commit e60b2f7716

@ -156,6 +156,14 @@ var ajaxify = {};
return tpl_url;
};
ajaxify.repositionNoWidgets = function() {
$('body [no-widget-class]').each(function() {
var $this = $(this);
$this.removeClass();
$this.addClass($this.attr('no-widget-class'));
});
};
ajaxify.renderWidgets = function(tpl_url, url, callback) {
var widgetLocations = [], numLocations;
@ -165,6 +173,10 @@ var ajaxify = {};
numLocations = widgetLocations.length;
if (!numLocations) {
ajaxify.repositionNoWidgets();
}
function renderWidgets(location) {
var area = $('#content [widget-area="' + location + '"]');
@ -175,11 +187,7 @@ var ajaxify = {};
})).removeClass('hidden');
if (!renderedWidgets.length) {
$('body [no-widget-class]').each(function() {
var $this = $(this);
$this.removeClass();
$this.addClass($this.attr('no-widget-class'));
});
ajaxify.repositionNoWidgets();
}
}

@ -204,9 +204,12 @@ define(['composer', 'forum/pagination'], function(composer, pagination) {
topic.find('span.timeago').timeago();
app.createUserTooltips();
ajaxify.renderWidgets('category', window.location.pathname.slice(1), function() {
$(window).trigger('action:categories.new_topic.loaded');
});
});
});
};
Category.onTopicsLoaded = function(topics, callback) {

Loading…
Cancel
Save