summaryrefslogtreecommitdiffstats
path: root/apps/contacts/js/interface.js
diff options
context:
space:
mode:
Diffstat (limited to 'apps/contacts/js/interface.js')
-rw-r--r--apps/contacts/js/interface.js18
1 files changed, 14 insertions, 4 deletions
diff --git a/apps/contacts/js/interface.js b/apps/contacts/js/interface.js
index b8a66d51aab..66ee6772198 100644
--- a/apps/contacts/js/interface.js
+++ b/apps/contacts/js/interface.js
@@ -1,15 +1,25 @@
$(document).ready(function(){
- /* $('.contacts_addressbooksexpander').click(function(){
- $('.contacts_addressbooksdetails').toggle();
- return false;
- });*/
+ /*-------------------------------------------------------------------------
+ * Actions for startup
+ *-----------------------------------------------------------------------*/
+ if( $('#leftcontent li').length > 0 ){
+ $('#leftcontent li').first().addClass('active');
+ }
+ /*-------------------------------------------------------------------------
+ * Event handlers
+ *-----------------------------------------------------------------------*/
$('#leftcontent li').live('click',function(){
var id = $(this).data('id');
+ var oldid = $('#rightcontent').data('id');
+ if(oldid != 0){
+ $('#leftcontent li[data-id="'+oldid+'"]').removeClass('active');
+ }
$.getJSON('ajax/getdetails.php',{'id':id},function(jsondata){
if(jsondata.status == 'success'){
$('#rightcontent').data('id',jsondata.data.id);
$('#rightcontent').html(jsondata.data.page);
+ $('#leftcontent li[data-id="'+jsondata.data.id+'"]').addClass('active');
}
else{
alert(jsondata.data.message);