Revision e6ec1867 snf-astakos-app/astakos/im/static/im/js/usage.js
b/snf-astakos-app/astakos/im/static/im/js/usage.js | ||
---|---|---|
113 | 113 |
|
114 | 114 |
_.each(this.meta.resources, function(group, index) { |
115 | 115 |
_.each(group[1], function(resource, rindex) { |
116 |
var resource_index = ordered.length; |
|
117 |
if (!_.contains(ordered, resource.name)) { |
|
118 |
ordered.push(resource.name); |
|
119 |
} else { |
|
120 |
resource_index = ordered.indexOf(resource.name); |
|
121 |
} |
|
122 |
resource.index = resource_index; |
|
123 | 116 |
resource.resource_name = resource.name.split(".")[1]; |
124 | 117 |
resources[resource.name] = resource; |
125 | 118 |
}) |
126 | 119 |
}); |
127 | 120 |
|
128 | 121 |
resources_ordered = _.filter(_.map(ordered, |
129 |
function(rk) { |
|
122 |
function(rk, index) { |
|
123 |
rk.index = index; |
|
130 | 124 |
return resources[rk] |
131 | 125 |
}), |
132 | 126 |
function(i) { return i}); |
Also available in: Unified diff