return !metric.hidden;
});
metrics = _.groupBy(metrics, 'domain');
- metrics = _.map(metrics, function (metrics, domain) {
+ metrics = _.map(metrics, function (list, domain) {
return {
domain: domain,
- metrics: _.sortBy(metrics, 'short_name')
+ metrics: _.sortBy(list, 'short_name')
};
});
return _.sortBy(metrics, 'domain');
highlight: function (id) {
this.highlighted = id;
this.render();
- },
+ }
});
});
onInputKeydown: function (e) {
this.query = this.$('input').val();
if (e.keyCode === 38) {
- return this.selectPreviousOption();
+ this.selectPreviousOption();
}
if (e.keyCode === 40) {
- return this.selectNextOption();
+ this.selectNextOption();
}
if (e.keyCode === 13) {
- return this.selectActiveOption();
- }
- if (e.keyCode === 9) {
- return false;
+ this.selectActiveOption();
}
if (e.keyCode === 27) {
- return this.close();
+ this.close();
+ }
+ if ([9, 13, 27, 38, 40].indexOf(e.keyCode) !== -1) {
+ return false;
}
},
onInputKeydown: function (e) {
this.query = this.$('input').val();
if (e.keyCode === 38) {
- return this.selectPreviousOption();
+ this.selectPreviousOption();
}
if (e.keyCode === 40) {
- return this.selectNextOption();
+ this.selectNextOption();
}
if (e.keyCode === 13) {
- return this.selectActiveOption();
- }
- if (e.keyCode === 9) {
- return false;
+ this.selectActiveOption();
}
if (e.keyCode === 27) {
- return this.close();
+ this.close();
+ }
+ if ([9, 13, 27, 38, 40].indexOf(e.keyCode) !== -1) {
+ return false;
}
},
}).done(function (r) {
var components = that.formatComponents(r);
if (components != null) {
- components = _.sortBy(components, function (d) {
- return -that.sizeMetric.value(d);
+ components = _.sortBy(components, function (component) {
+ return -that.sizeMetric.value(component);
});
components = _.initial(components, components.length - that.options().maxItems - 1);
that.updateTreemap(components, components.length > that.options().maxItems);