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:
parent
074406a7f0
commit
2bb2140ee3
@ -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);
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user