Changed javascript to ask for callbacks rather than elements

This commit is contained in:
Alex Grande
2011-01-12 10:39:48 -08:00
parent 7361b558b4
commit 39d238d9f4

View File

@@ -1,14 +1,13 @@
var ContactView = function() {};
ContactView.prototype.show = function(nameElement, phoneElement) {
ContactView.prototype.show = function(successCallback, failCallback) {
function success(args) {
nameElement.value = typeof args.name != "undefined" ? args.name : "";
phoneElement.value = typeof args.phone != "undefined" ? args.phone : "";
successCallback(args);
}
function fail(args) {
alert("fail "+args)
failCallback(args);
}
return PhoneGap.exec(function(args) {