mirror of
https://github.com/apache/cordova-android.git
synced 2026-04-23 00:00:09 +08:00
Fixed small contacts and accelerometer object instantiation bugs. Added a bit more delay to PhoneGap constructor, 1ms caused issues sometimes I *think*.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
var Contact = function(){
|
||||
this.name = null;
|
||||
this.name = new ContactName();
|
||||
this.emails = [];
|
||||
this.phones = [];
|
||||
}
|
||||
@@ -37,7 +37,18 @@ Contacts.prototype.find = function(obj, win, fail)
|
||||
{
|
||||
if(obj.name != null)
|
||||
{
|
||||
ContactHook.search(name, "", "");
|
||||
// Build up the search term that we'll use in SQL, based on the structure/contents of the contact object passed into find.
|
||||
var searchTerm = '';
|
||||
if (obj.name.givenName && obj.name.givenName.length > 0) {
|
||||
searchTerm = obj.name.givenName.split(' ').join('%');
|
||||
}
|
||||
if (obj.name.familyName && obj.name.familyName.length > 0) {
|
||||
searchTerm += obj.name.familyName.split(' ').join('%');
|
||||
}
|
||||
if (!obj.name.familyName && !obj.name.givenName && obj.name.formatted) {
|
||||
searchTerm = obj.name.formatted;
|
||||
}
|
||||
ContactHook.search(searchTerm, "", "");
|
||||
}
|
||||
this.win = win;
|
||||
this.fail = fail;
|
||||
|
||||
Reference in New Issue
Block a user