Always select last month after loading them.

This commit is contained in:
Alexis Lahouze 2013-01-08 18:53:45 +01:00
parent 5ccddb0511
commit 9b1c906032

View File

@ -180,10 +180,8 @@ var ListViewModel = function() {
self.loadMonths = function(account){ self.loadMonths = function(account){
$.post("api/entry.php", {action: "get_months", account: account.id}).success(function (result) { $.post("api/entry.php", {action: "get_months", account: account.id}).success(function (result) {
self.months(result); self.months(result);
if(! self.month()) { self.month(result[result.length - 1]);
self.month(result[result.length - 1]);
}
}); });
}; };