From 1c5aa6cd008b65e55661be0674b9873af9da9c30 Mon Sep 17 00:00:00 2001 From: macdonst Date: Fri, 19 Nov 2010 00:45:36 +0800 Subject: [PATCH] Adding a cast for contacts.find() --- framework/assets/js/contact.js | 11 ++++++----- framework/assets/js/phonegap.js.base | 18 ++++-------------- framework/src/com/phonegap/ContactManager.java | 2 +- .../src/com/phonegap/api/PluginResult.java | 14 +++++++++++++- 4 files changed, 24 insertions(+), 21 deletions(-) diff --git a/framework/assets/js/contact.js b/framework/assets/js/contact.js index 984ca37f..9da9ab3b 100755 --- a/framework/assets/js/contact.js +++ b/framework/assets/js/contact.js @@ -242,7 +242,7 @@ var Contacts = function() { * @return array of Contacts matching search criteria */ Contacts.prototype.find = function(fields, successCB, errorCB, options) { - PhoneGap.exec(successCB, errorCB, "Contacts", "search", [fields, options], navigator.service.contacts.cast); + PhoneGap.exec(successCB, errorCB, "Contacts", "search", [fields, options]); }; /** @@ -270,12 +270,13 @@ Contacts.prototype.create = function(properties) { * @param jsonArray an array of JSON Objects that need to be converted to Contact objects. * @returns an array of Contact objects */ -Contacts.prototype.cast = function(jsonArray) { +Contacts.prototype.cast = function(pluginResult) { var contacts = new Array(); - for (var i=0; i