1
0
mirror of https://github.com/owncloudarchive/contacts.git synced 2024-12-01 13:24:10 +01:00

Ensure event handlers are being set when adding first contact.

This commit is contained in:
Thomas Tanghus 2012-06-27 02:10:50 +02:00
parent 074406a7f0
commit 2bb2140ee3

View File

@ -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);
});