summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorThomas Tanghus <thomas@tanghus.net>2012-07-22 15:01:35 +0200
committerThomas Tanghus <thomas@tanghus.net>2012-07-23 01:17:38 +0200
commitb60e5942a526ffa87ca118261f13debdafdda810 (patch)
tree65428b63ce8e33211aa9d1e6711f90810f96c96c /apps
parentfb9ef90c45d9993febc4c9481f6b74ca8f467d73 (diff)
downloadnextcloud-server-b60e5942a526ffa87ca118261f13debdafdda810.tar.gz
nextcloud-server-b60e5942a526ffa87ca118261f13debdafdda810.zip
Cleaner event handling.
Diffstat (limited to 'apps')
-rw-r--r--apps/contacts/js/contacts.js21
1 files changed, 8 insertions, 13 deletions
diff --git a/apps/contacts/js/contacts.js b/apps/contacts/js/contacts.js
index d33f16e4e93..f9b60a0e4f8 100644
--- a/apps/contacts/js/contacts.js
+++ b/apps/contacts/js/contacts.js
@@ -1679,18 +1679,13 @@ $(document).ready(function(){
OCCategories.changed = Contacts.UI.Card.categoriesChanged;
OCCategories.app = 'contacts';
- $('#notification').click(function(){
- $('#notification').fadeOut();
- });
-
- $('#chooseaddressbook').click(Contacts.UI.Addressbooks.overview);
- $('#chooseaddressbook').keydown(Contacts.UI.Addressbooks.overview);
+ $('#chooseaddressbook').on('click keydown', Contacts.UI.Addressbooks.overview);
+ $('#contacts_newcontact').on('click keydown', Contacts.UI.Card.editNew);
- $('#contacts_newcontact').click(Contacts.UI.Card.editNew);
- $('#contacts_newcontact').keydown(Contacts.UI.Card.editNew);
+ var ninjahelp = $('#ninjahelp');
- $('#ninjahelp .close').on('click keydown',function() {
- $('#ninjahelp').hide();
+ ninjahelp.find('.close').on('click keydown',function() {
+ ninjahelp.hide();
});
$(document).on('keyup', function(event) {
@@ -1708,7 +1703,7 @@ $(document).ready(function(){
*/
switch(event.which) {
case 27: // Esc
- $('#ninjahelp').hide();
+ ninjahelp.hide();
break;
case 46:
if(event.shiftKey) {
@@ -1755,7 +1750,7 @@ $(document).ready(function(){
Contacts.UI.Contacts.update({cid:Contacts.UI.Card.id});
break;
case 191: // ?
- $('#ninjahelp').toggle('fast');
+ ninjahelp.toggle('fast');
break;
}
@@ -1767,7 +1762,7 @@ $(document).ready(function(){
$('.contacts').click();
}
});
- $(document).on('click', '.contacts', function(event){
+ $(document).on('click', '#contacts', function(event){
var $tgt = $(event.target);
if ($tgt.is('li') || $tgt.is('a')) {
var item = $tgt.is('li')?$($tgt):($tgt).parent();