don't assume /strict or /ignore will return a response

This commit is contained in:
Matt Claypotch 2012-03-29 14:53:25 -07:00
Родитель 8c1c350d40
Коммит 2117a4ccb3
1 изменённых файлов: 16 добавлений и 14 удалений

Просмотреть файл

@ -104,21 +104,23 @@ function hideInstalled() {
if (numListed < minSpots) {
var emptySpots = minSpots - numListed;
$.get(url, function(data) {
$.each($(data).find('li'), function() {
var $el = $(this),
guid = $el.attr('data-guid');
// Ensure that the add-on isn't already in the list and
// that it's not already installed by the user.
if (!ul.find(format('li[data-guid="{0}"]', [guid])).length &&
$.inArray(guid, z.guids) === -1) {
ul.append($el);
// We're done if all spots have been filled.
if (emptySpots-- == 1) {
return false;
if ($.trim(data)) {
$.each($(data).find('li'), function() {
var $el = $(this),
guid = $el.attr('data-guid');
// Ensure that the add-on isn't already in the list and
// that it's not already installed by the user.
if (!ul.find(format('li[data-guid="{0}"]', [guid])).length &&
$.inArray(guid, z.guids) === -1) {
ul.append($el);
// We're done if all spots have been filled.
if (emptySpots-- == 1) {
return false;
}
}
}
});
initTrunc();
});
initTrunc();
}
});
}
}