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

add confirmation before deleting an addressbook

This commit is contained in:
babelouest 2015-01-29 10:08:11 -05:00 committed by Thomas Müller
parent 8009a4f262
commit f7f70fe6ea

View File

@ -62,9 +62,14 @@ OC.Contacts = OC.Contacts || {};
}
));
this.$li.find('a.action.delete').on('click keypress', function() {
OC.dialogs.confirm(t('contacts', 'Are you sure you want to delete the addressbook {addressbook} ?', {addressbook: self.getDisplayName()}),
t('contacts', 'Remove addressbook'), function(answer) {
if (answer) {
$('.tipsy').remove();
console.log('delete', self.getId());
self.destroy();
}
});
});
this.$li.find('a.action.carddav').on('click keypress', function() {
var uri = (self.book.owner === oc_current_user ) ? self.book.uri : self.book.uri + '_shared_by_' + self.book.owner;