]> source.dussan.org Git - nextcloud-server.git/commitdiff
Click to select which address book to add to.
authorThomas Tanghus <thomas@tanghus.net>
Sun, 24 Jun 2012 14:03:10 +0000 (16:03 +0200)
committerThomas Tanghus <thomas@tanghus.net>
Sun, 24 Jun 2012 14:03:10 +0000 (16:03 +0200)
apps/contacts/css/contacts.css
apps/contacts/js/contacts.js

index 6c65db2b772a34d5230ad7b7d28b41fb9988b18f..fb5bcb2b70c7d4f1eecf6ba659ec90ad51133bcc 100644 (file)
@@ -5,7 +5,7 @@
 #leftcontent a { padding: 0 0 0 25px; }
 #rightcontent { top: 3.5em !important; padding-top: 5px; }
 #leftcontent h3 { cursor: pointer; -moz-transition: background 300ms ease 0s; background: none no-repeat scroll 1em center #eee; border-bottom: 1px solid #ddd; border-top: 1px solid #fff; display: block; max-width: 100%; padding: 0.5em 0.8em; color: #666; text-shadow: 0 1px 0 #f8f8f8; font-size: 1.2em; }
-#leftcontent h3:hover { background-color: #DBDBDB; border-bottom: 1px solid #CCCCCC; border-top: 1px solid #D4D4D4; color: #333333; }
+#leftcontent h3:hover,#leftcontent h3:active,#leftcontent h3.active { background-color: #DBDBDB; border-bottom: 1px solid #CCCCCC; border-top: 1px solid #D4D4D4; color: #333333; }
 #contacts { position: fixed; background: #fff; max-width: 100%; width: 20em; left: 12.5em; top: 3.7em; bottom: 3em; overflow: auto; padding: 0; margin: 0; }
 .contacts a { height: 23px; display: block; left: 12.5em; margin: 0 0 0 0; padding: 0 0 0 25px; }
 #bottomcontrols { padding: 0; bottom:0px; height:2.8em; width: 20em; margin:0; background:#eee; border-top:1px solid #ccc; position:fixed; -moz-box-shadow: 0 -3px 3px -3px #000; -webkit-box-shadow: 0 -3px 3px -3px #000; box-shadow: 0 -3px 3px -3px #000;}
index 0654976a6ddf6914888ea11d2fdb60b54111838e..0325b2cec2a93a1bc5db702376111d4cdd09f00a 100644 (file)
@@ -310,10 +310,11 @@ Contacts={
                        editNew:function(){ // add a new contact
                                this.id = ''; this.fn = ''; this.fullname = ''; this.givname = ''; this.famname = ''; this.addname = ''; this.honpre = ''; this.honsuf = '';
                                //Contacts.UI.Card.add(t('contacts', 'Contact')+';'+t('contacts', 'New')+';;;', t('contacts', 'New Contact'), '', true);
-                               Contacts.UI.Card.add(';;;;;', '', '', true);
+                               Contacts.UI.Card.add(';;;;;', '', this.bookid, true);
                                return false;
                        },
                        add:function(n, fn, aid, isnew){ // add a new contact
+                               aid = aid?aid:$('#contacts h3.active').first().data('id');
                                var localAddcontact = function(n, fn, aid, isnew) {
                                        $.post(OC.filePath('contacts', 'ajax', 'addcontact.php'), { n: n, fn: fn, aid: aid, isnew: isnew },
                                        function(jsondata) {
@@ -1605,6 +1606,8 @@ $(document).ready(function(){
        });
 
        $(document).on('click', '.addressbook', function(event){
+               $('#contacts h3').removeClass('active');
+               $(this).addClass('active');
                $(this).next().slideToggle(300);
                return false;
        });