diff options
author | Thomas Tanghus <thomas@tanghus.net> | 2012-07-21 21:59:04 +0200 |
---|---|---|
committer | Thomas Tanghus <thomas@tanghus.net> | 2012-07-21 22:00:27 +0200 |
commit | 359dc8736a98118f50ae449bd05f164458bad5ce (patch) | |
tree | 1a5dac41ef5235a46f0e566f0a6ef565f257816a /apps/contacts/js | |
parent | eb57544518cc0a12618fdb72b65b129c7d18c923 (diff) | |
download | nextcloud-server-359dc8736a98118f50ae449bd05f164458bad5ce.tar.gz nextcloud-server-359dc8736a98118f50ae449bd05f164458bad5ce.zip |
Improved scrollTo method. Still not quite there...
Diffstat (limited to 'apps/contacts/js')
-rw-r--r-- | apps/contacts/js/contacts.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/contacts/js/contacts.js b/apps/contacts/js/contacts.js index a0ad77d0749..514821a44f3 100644 --- a/apps/contacts/js/contacts.js +++ b/apps/contacts/js/contacts.js @@ -1687,10 +1687,10 @@ Contacts={ }, scrollTo:function(id){ var item = $('#contacts li[data-id="'+id+'"]'); - console.log('scrollTo, found item '+id+'? ' + item.length); - if(item) { + if(item && $.isNumeric(item.offset().top)) { + console.log('scrollTo ' + parseInt(item.offset().top)); $('#contacts').animate({ - scrollTop: item.offset().top-40}, 'slow','swing'); + scrollTop: parseInt(item.offset()).top-40}, 'slow','swing'); } } } |