From 768041b6cba5e8d4614e17d2ad492c855ec740a0 Mon Sep 17 00:00:00 2001
From: Thomas Tanghus <thomas@tanghus.net>
Date: Fri, 27 Apr 2012 10:34:45 +0200
Subject: [PATCH] Contacts: Added convinience method for notifications.

---
 apps/contacts/js/contacts.js | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/apps/contacts/js/contacts.js b/apps/contacts/js/contacts.js
index 48ebecefbb..e649e1744c 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;
-- 
GitLab