1
0
mirror of https://github.com/owncloudarchive/contacts.git synced 2025-01-30 19:52:17 +01:00

Missing 'var's and add failure handlers

This commit is contained in:
Thomas Tanghus 2014-03-24 21:21:45 +01:00
parent 1c79e69937
commit fab6f0793d

View File

@ -225,7 +225,7 @@ OC.notify = function(params) {
}).fail(function(response) { }).fail(function(response) {
console.warn(response); console.warn(response);
self.$rightContent.removeClass('loading'); self.$rightContent.removeClass('loading');
message = t('contacts', 'Unrecoverable error loading address books: {msg}', {msg:response.message}); var message = t('contacts', 'Unrecoverable error loading address books: {msg}', {msg:response.message});
OC.dialogs.alert(message, t('contacts', 'Error.')); OC.dialogs.alert(message, t('contacts', 'Error.'));
}); });
}).fail(function(response) { }).fail(function(response) {
@ -501,7 +501,7 @@ OC.notify = function(params) {
} }
break; break;
case 'adr': case 'adr':
address = data.url.filter(function(n) { var address = data.url.filter(function(n) {
return n; return n;
}); });
var newWindow = window.open('http://open.mapquest.com/?q='+address, '_blank'); var newWindow = window.open('http://open.mapquest.com/?q='+address, '_blank');
@ -1552,6 +1552,10 @@ OC.notify = function(params) {
} else { } else {
$(document).trigger('status.contacts.error', response); $(document).trigger('status.contacts.error', response);
} }
}).fail(function(response) {
response = self.storage.formatResponse(jqXHR);
console.warn('response', response);
$(document).trigger('status.contacts.error', response);
}); });
}, },
editCurrentPhoto:function(metadata) { editCurrentPhoto:function(metadata) {
@ -1568,6 +1572,10 @@ OC.notify = function(params) {
} else { } else {
$(document).trigger('status.contacts.error', response); $(document).trigger('status.contacts.error', response);
} }
}).fail(function(response) {
response = self.storage.formatResponse(jqXHR);
console.warn('response', response);
$(document).trigger('status.contacts.error', response);
}); });
}, },
editPhoto:function(metadata, tmpkey) { editPhoto:function(metadata, tmpkey) {