Contacts: Added convinience method for notifications.

This commit is contained in:
Thomas Tanghus 2012-04-27 10:34:45 +02:00
parent 18c11ec81b
commit 768041b6cb
1 changed files with 12 additions and 0 deletions

View File

@ -12,6 +12,14 @@ String.prototype.strip_tags = function(){
Contacts={ Contacts={
UI:{ UI:{
notification:function(msg, ndata) {
$('#notification').text(msg);
if(data) {
$('#notification').data(ndata[0],ndata[1]);
}
$('#notification').fadeIn();
setTimeout($('#notification').fadeOut(), 10000);
},
notImplemented:function() { notImplemented:function() {
OC.dialogs.alert(t('contacts', 'Sorry, this functionality has not been implemented yet'), t('contacts', 'Not implemented')); 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.changed = Contacts.UI.Card.categoriesChanged;
OCCategories.app = 'contacts'; OCCategories.app = 'contacts';
$('#notification').click(function(){
$('#notification').fadeOut();
});
$('#chooseaddressbook').click(function(){ $('#chooseaddressbook').click(function(){
Contacts.UI.Addressbooks.overview(); Contacts.UI.Addressbooks.overview();
return false; return false;