diff options
author | Bartek Przybylski <bart.p.pl@gmail.com> | 2011-12-30 17:06:48 +0100 |
---|---|---|
committer | Bartek Przybylski <bart.p.pl@gmail.com> | 2011-12-30 17:06:48 +0100 |
commit | 96dc279e8ea0d18201bc71af989d16224e4d66f7 (patch) | |
tree | 945282239b28db304e87390b656df5c5374eae6b /apps/contacts/js/interface.js | |
parent | 2ea20862fcef773d4262c78835b16fb5827ecfe2 (diff) | |
parent | ed2ba4e8e40b6877f71c1205ff9a7bd2b46f30e0 (diff) | |
download | nextcloud-server-96dc279e8ea0d18201bc71af989d16224e4d66f7.tar.gz nextcloud-server-96dc279e8ea0d18201bc71af989d16224e4d66f7.zip |
Merge branch 'master' of gitorious.org:owncloud/owncloud
Diffstat (limited to 'apps/contacts/js/interface.js')
-rw-r--r-- | apps/contacts/js/interface.js | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/apps/contacts/js/interface.js b/apps/contacts/js/interface.js index 02470d5a767..3190efae3cc 100644 --- a/apps/contacts/js/interface.js +++ b/apps/contacts/js/interface.js @@ -108,6 +108,18 @@ Contacts={ }) $.each(contacts, function(idx, itm) { contactlist.append(itm); }); */ + setTimeout(Contacts.UI.Contacts.lazyupdate(), 500); + }, + lazyupdate:function(){ + //alert('lazyupdate'); + $('#contacts li').live('inview', function(){ + if (!$(this).attr('style')) { + //alert($(this).data('id') + ' has background: ' + $(this).attr('style')); + $(this).css('background','url(thumbnail.php?id='+$(this).data('id')+') no-repeat'); + }/* else { + alert($(this).data('id') + ' has style ' + $(this).attr('style').match('url')); + }*/ + }); } } } @@ -279,4 +291,25 @@ $(document).ready(function(){ }); $('#contacts_addcardform select').chosen(); + + $('#contacts li').bind('inview', function(event, isInView, visiblePartX, visiblePartY) { + if (isInView) { //NOTE: I've kept all conditions for future reference ;-) + // element is now visible in the viewport + if (visiblePartY == 'top') { + // top part of element is visible + } else if (visiblePartY == 'bottom') { + // bottom part of element is visible + } else { + // whole part of element is visible + if (!$(this).attr('style')) { + //alert($(this).data('id') + ' has background: ' + $(this).attr('style')); + $(this).css('background','url(thumbnail.php?id='+$(this).data('id')+') no-repeat'); + }/* else { + alert($(this).data('id') + ' has style ' + $(this).attr('style').match('url')); + }*/ + } + } else { + // element has gone out of viewport + } + }); }); |