Add filterMethod to hint dropdown

This commit is contained in:
Clement Ho 2016-12-06 16:23:04 -06:00
parent 6d2d2b2bd1
commit b16a38c8a2

View file

@ -42,6 +42,18 @@
super.renderContent();
droplab.setData(this.hookId, dropdownData);
}
filterMethod(item, query) {
const { value } = gl.FilteredSearchTokenizer.getLastTokenObject(query);
if (value === '') {
item.droplab_hidden = false;
} else {
item.droplab_hidden = item['hint'].indexOf(value) === -1;
}
return item;
}
}
global.DropdownHint = DropdownHint;