mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
Merge pull request #2294 from spenceralger/fix_ip_popularity_test
prevent IndexPattern#popularizeField from going negative
This commit is contained in:
commit
54b30d34dc
1 changed files with 5 additions and 3 deletions
|
@ -169,9 +169,11 @@ define(function (require) {
|
|||
if (!(self.fields.byName && self.fields.byName[fieldName])) return;
|
||||
|
||||
var field = self.fields.byName[fieldName];
|
||||
if (!field.count && unit < 1) return;
|
||||
field.count = field.count + (unit);
|
||||
self.save();
|
||||
var count = Math.max(field.count + unit, 0);
|
||||
if (field.count !== count) {
|
||||
field.count = count;
|
||||
self.save();
|
||||
}
|
||||
};
|
||||
|
||||
self.getFields = function (type) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue