summaryrefslogtreecommitdiffstats
path: root/apps/contacts
diff options
context:
space:
mode:
authorThomas Tanghus <thomas@tanghus.net>2012-06-27 02:10:50 +0200
committerThomas Tanghus <thomas@tanghus.net>2012-06-27 02:12:53 +0200
commit823bef3a090fdcfc0ac6ad6662e5535d7a5aae72 (patch)
tree20d400c91088446b0c0c544c96e22fa298e27849 /apps/contacts
parentafd9705283c177fc12892e9edb2425ae380fcfa1 (diff)
downloadnextcloud-server-823bef3a090fdcfc0ac6ad6662e5535d7a5aae72.tar.gz
nextcloud-server-823bef3a090fdcfc0ac6ad6662e5535d7a5aae72.zip
Ensure event handlers are being set when adding first contact.
Diffstat (limited to 'apps/contacts')
-rw-r--r--apps/contacts/js/contacts.js48
1 files changed, 24 insertions, 24 deletions
diff --git a/apps/contacts/js/contacts.js b/apps/contacts/js/contacts.js
index 64b7af850ea..f4c361082c8 100644
--- a/apps/contacts/js/contacts.js
+++ b/apps/contacts/js/contacts.js
@@ -234,6 +234,30 @@ Contacts={
$('#contacts_downloadcard').tipsy({gravity: 'ne'});
$('#contacts_propertymenu_button').tipsy();
$('#contacts_newcontact, #chooseaddressbook').tipsy({gravity: 'sw'});
+
+ $('body').click(function(e){
+ if(!$(e.target).is('#contacts_propertymenu_button')) {
+ $('#contacts_propertymenu_dropdown').hide();
+ }
+ });
+ function propertyMenu(){
+ var menu = $('#contacts_propertymenu_dropdown');
+ if(menu.is(':hidden')) {
+ menu.show();
+ menu.find('li').first().focus();
+ } else {
+ menu.hide();
+ }
+ }
+ $('#contacts_propertymenu_button').click(propertyMenu);
+ $('#contacts_propertymenu_button').keydown(propertyMenu);
+ function propertyMenuItem(){
+ var type = $(this).data('type');
+ Contacts.UI.Card.addProperty(type);
+ $('#contacts_propertymenu_dropdown').hide();
+ }
+ $('#contacts_propertymenu_dropdown a').click(propertyMenuItem);
+ $('#contacts_propertymenu_dropdown a').keydown(propertyMenuItem);
},
Card:{
id:'',
@@ -1739,30 +1763,6 @@ $(document).ready(function(){
xhr.send(file);
}
- $('body').click(function(e){
- if(!$(e.target).is('#contacts_propertymenu_button')) {
- $('#contacts_propertymenu_dropdown').hide();
- }
- });
- function propertyMenu(){
- var menu = $('#contacts_propertymenu_dropdown');
- if(menu.is(':hidden')) {
- menu.show();
- menu.find('li').first().focus();
- } else {
- menu.hide();
- }
- }
- $('#contacts_propertymenu_button').click(propertyMenu);
- $('#contacts_propertymenu_button').keydown(propertyMenu);
- function propertyMenuItem(){
- var type = $(this).data('type');
- Contacts.UI.Card.addProperty(type);
- $('#contacts_propertymenu_dropdown').hide();
- }
- $('#contacts_propertymenu_dropdown a').click(propertyMenuItem);
- $('#contacts_propertymenu_dropdown a').keydown(propertyMenuItem);
-
Contacts.UI.loadHandlers();
Contacts.UI.Contacts.update(id);
});