website: Javascript code cleanup
By inversing the "if (!result.error)" we gain one level of indent. Also moving variable declarations into a more correct block of code. Signed-off-by: Maxime Hadjinlian <maxime.hadjinlian@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
This commit is contained in:
parent
4438ccafcb
commit
de6d6b9454
|
@ -1,11 +1,13 @@
|
|||
function load_activity(feedurl, divid) {
|
||||
var feed = new google.feeds.Feed(feedurl);
|
||||
feed.setNumEntries(30);
|
||||
feed.load(function(result) {
|
||||
if (!result.error) {
|
||||
var container = document.getElementById(divid);
|
||||
var loaded = 0;
|
||||
var nb_display = 8;
|
||||
feed.setNumEntries(30);
|
||||
feed.load(function(result) {
|
||||
if (result.error) {
|
||||
return;
|
||||
}
|
||||
for (var i = 0; i < result.feed.entries.length; i++) {
|
||||
var entry = result.feed.entries[i];
|
||||
if (entry.title.indexOf("git commit") != -1)
|
||||
|
@ -28,7 +30,6 @@ function load_activity(feedurl, divid) {
|
|||
for (var i = 0; i < empty; i++) {
|
||||
container.appendChild(document.createElement("p"));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user