[gnome-weather] WorldView: fix the order in which locations are added
- From: Giovanni Campagna <gcampagna src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-weather] WorldView: fix the order in which locations are added
- Date: Sat, 7 Mar 2015 04:40:31 +0000 (UTC)
commit 5a5205eccdca5212126edfabd61521435f5e987c
Author: Giovanni Campagna <gcampagna src gnome org>
Date: Fri Mar 6 19:06:43 2015 -0800
WorldView: fix the order in which locations are added
_onLocationAdded adds to the front of the popup (because it
expects the location to be the most recently viewed), so we
need to walk the list backwards.
src/app/world.js | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/app/world.js b/src/app/world.js
index 0de79d9..3271f36 100644
--- a/src/app/world.js
+++ b/src/app/world.js
@@ -116,9 +116,9 @@ const WorldContentView = new Lang.Class({
this._currentLocationAdded = false;
if (this.model.length > 0) {
- this.model.getAll().forEach(Lang.bind(this, function(info) {
- this._onLocationAdded(this.model, info, info._isCurrentLocation);
- }));
+ let list = this.model.getAll();
+ for (let i = list.length - 1; i >= 0; i--)
+ this._onLocationAdded(this.model, list[i], list[i]._isCurrentLocation);
} else {
this.model.load();
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]