From dafa3d8d43f6e1bd3305475b7e84c0af77830578 Mon Sep 17 00:00:00 2001 From: babelouest Date: Thu, 29 Jan 2015 10:08:11 -0500 Subject: [PATCH] add confirmation before deleting an addressbook --- js/addressbooks.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/js/addressbooks.js b/js/addressbooks.js index ae3c4707..35934d98 100644 --- a/js/addressbooks.js +++ b/js/addressbooks.js @@ -62,9 +62,14 @@ OC.Contacts = OC.Contacts || {}; } )); this.$li.find('a.action.delete').on('click keypress', function() { - $('.tipsy').remove(); - console.log('delete', self.getId()); - self.destroy(); + 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;