From: Thomas Tanghus Date: Fri, 27 Apr 2012 08:34:45 +0000 (+0200) Subject: Contacts: Added convinience method for notifications. X-Git-Tag: v4.0.0beta~170 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=768041b6cba5e8d4614e17d2ad492c855ec740a0;p=nextcloud-server.git Contacts: Added convinience method for notifications. --- diff --git a/apps/contacts/js/contacts.js b/apps/contacts/js/contacts.js index 48ebecefbb5..e649e1744c3 100644 --- a/apps/contacts/js/contacts.js +++ b/apps/contacts/js/contacts.js @@ -12,6 +12,14 @@ String.prototype.strip_tags = function(){ Contacts={ UI:{ + notification:function(msg, ndata) { + $('#notification').text(msg); + if(data) { + $('#notification').data(ndata[0],ndata[1]); + } + $('#notification').fadeIn(); + setTimeout($('#notification').fadeOut(), 10000); + }, notImplemented:function() { OC.dialogs.alert(t('contacts', 'Sorry, this functionality has not been implemented yet'), t('contacts', 'Not implemented')); }, @@ -1536,6 +1544,10 @@ $(document).ready(function(){ OCCategories.changed = Contacts.UI.Card.categoriesChanged; OCCategories.app = 'contacts'; + $('#notification').click(function(){ + $('#notification').fadeOut(); + }); + $('#chooseaddressbook').click(function(){ Contacts.UI.Addressbooks.overview(); return false;