]> source.dussan.org Git - nextcloud-server.git/commitdiff
Contacts: Added convinience method for notifications.
authorThomas Tanghus <thomas@tanghus.net>
Fri, 27 Apr 2012 08:34:45 +0000 (10:34 +0200)
committerThomas Tanghus <thomas@tanghus.net>
Fri, 27 Apr 2012 08:35:31 +0000 (10:35 +0200)
apps/contacts/js/contacts.js

index 48ebecefbb5b1937f393eee800ea8efa46405742..e649e1744c3ef995ea62a78586e88ae8ac653ec7 100644 (file)
@@ -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;