Improve typeahead contact selector experience
Store and match on various phone number formats. Still not perfect, as occasionally all the models are returned for a non-matching query.
This commit is contained in:
parent
acc2c6f536
commit
d435ff003b
3 changed files with 21 additions and 15 deletions
|
@ -33,6 +33,14 @@
|
|||
}
|
||||
},
|
||||
|
||||
splitCountryCode: function(number) {
|
||||
var parsedNumber = libphonenumber.parse(number);
|
||||
return {
|
||||
country_code: parsedNumber.values_[1],
|
||||
national_number: parsedNumber.values_[2]
|
||||
};
|
||||
},
|
||||
|
||||
getCountryCode: function(regionCode) {
|
||||
var cc = libphonenumber.getCountryCodeForRegion(regionCode);
|
||||
return (cc != 0) ? cc : "";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue