mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-09 07:25:46 +01:00
closes #1174
This commit is contained in:
@@ -156,6 +156,14 @@ var ajaxify = {};
|
|||||||
return tpl_url;
|
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) {
|
ajaxify.renderWidgets = function(tpl_url, url, callback) {
|
||||||
var widgetLocations = [], numLocations;
|
var widgetLocations = [], numLocations;
|
||||||
|
|
||||||
@@ -165,6 +173,10 @@ var ajaxify = {};
|
|||||||
|
|
||||||
numLocations = widgetLocations.length;
|
numLocations = widgetLocations.length;
|
||||||
|
|
||||||
|
if (!numLocations) {
|
||||||
|
ajaxify.repositionNoWidgets();
|
||||||
|
}
|
||||||
|
|
||||||
function renderWidgets(location) {
|
function renderWidgets(location) {
|
||||||
var area = $('#content [widget-area="' + location + '"]');
|
var area = $('#content [widget-area="' + location + '"]');
|
||||||
|
|
||||||
@@ -175,11 +187,7 @@ var ajaxify = {};
|
|||||||
})).removeClass('hidden');
|
})).removeClass('hidden');
|
||||||
|
|
||||||
if (!renderedWidgets.length) {
|
if (!renderedWidgets.length) {
|
||||||
$('body [no-widget-class]').each(function() {
|
ajaxify.repositionNoWidgets();
|
||||||
var $this = $(this);
|
|
||||||
$this.removeClass();
|
|
||||||
$this.addClass($this.attr('no-widget-class'));
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -204,9 +204,12 @@ define(['composer', 'forum/pagination'], function(composer, pagination) {
|
|||||||
topic.find('span.timeago').timeago();
|
topic.find('span.timeago').timeago();
|
||||||
app.createUserTooltips();
|
app.createUserTooltips();
|
||||||
|
|
||||||
|
|
||||||
|
ajaxify.renderWidgets('category', window.location.pathname.slice(1), function() {
|
||||||
$(window).trigger('action:categories.new_topic.loaded');
|
$(window).trigger('action:categories.new_topic.loaded');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
Category.onTopicsLoaded = function(topics, callback) {
|
Category.onTopicsLoaded = function(topics, callback) {
|
||||||
|
|||||||
Reference in New Issue
Block a user