simplified widgets

v1.18.x
psychobunny 11 years ago
parent 4f04bd82a6
commit 0c8c246be4

@ -29,15 +29,20 @@
var area = $('#content [widget-area="' + location + '"]');
socket.emit('widgets.render', {template: tpl_url + '.tpl', url: url, location: location}, function(err, renderedWidgets) {
if (area.html()) {
area.html(templates.parse(area.html(), {widgets: renderedWidgets}))
.removeClass('hidden');
var html = '';
if (!renderedWidgets.length) {
ajaxify.widgets.reposition();
for (var widget in renderedWidgets) {
if (renderedWidgets.hasOwnProperty(widget)) {
html += renderedWidgets[widget].html;
}
}
area.html(html).removeClass('hidden');
if (!renderedWidgets.length) {
ajaxify.widgets.reposition();
}
$('#content [widget-area] img:not(.user-img)').addClass('img-responsive');
checkCallback();
});

Loading…
Cancel
Save