summaryrefslogtreecommitdiffstats
path: root/apps/contacts/js/contacts.js
diff options
context:
space:
mode:
authorThomas Tanghus <thomas@tanghus.net>2012-06-17 20:23:20 +0200
committerThomas Tanghus <thomas@tanghus.net>2012-06-17 20:25:32 +0200
commit5a8f4b87839baaeb3b557895cc89d58e19ad75ce (patch)
tree3645e15426ef1ee9858bc2f257caf52df3d2a7db /apps/contacts/js/contacts.js
parentb6b6d691582a22437b4f96e1c9f5915635dc4815 (diff)
downloadnextcloud-server-5a8f4b87839baaeb3b557895cc89d58e19ad75ce.tar.gz
nextcloud-server-5a8f4b87839baaeb3b557895cc89d58e19ad75ce.zip
Adjustments for inview handler etc.
Diffstat (limited to 'apps/contacts/js/contacts.js')
-rw-r--r--apps/contacts/js/contacts.js26
1 files changed, 21 insertions, 5 deletions
diff --git a/apps/contacts/js/contacts.js b/apps/contacts/js/contacts.js
index 925dbafe467..981af6f53a6 100644
--- a/apps/contacts/js/contacts.js
+++ b/apps/contacts/js/contacts.js
@@ -1498,23 +1498,34 @@ Contacts={
update:function(){
$.getJSON(OC.filePath('contacts', 'ajax', 'contacts.php'),{},function(jsondata){
if(jsondata.status == 'success'){
- $('#leftcontent').html(jsondata.data.page);
+ $('#leftcontent').html(jsondata.data.page).ready(function() {
+ setTimeout(function() {
+ $('.contacts li').unbind('inview');
+ $('.contacts li:visible').bind('inview', function(event, isInView, visiblePartX, visiblePartY) {
+ if (isInView) {
+ if (!$(this).find('a').attr('style')) {
+ $(this).find('a').css('background','url('+OC.filePath('contacts', '', 'thumbnail.php')+'?id='+$(this).data('id')+') no-repeat');
+ }
+ }
+ })}, 100);
+ setTimeout(Contacts.UI.Contacts.lazyupdate, 500);
+ });
Contacts.UI.Card.update();
}
else{
OC.dialogs.alert(jsondata.data.message, t('contacts', 'Error'));
}
});
- setTimeout(function() {
+ /*setTimeout(function() {
$('.contacts li').unbind('inview');
- $('.contacts li').bind('inview', function(event, isInView, visiblePartX, visiblePartY) {
+ $('.contacts li:visible').bind('inview', function(event, isInView, visiblePartX, visiblePartY) {
if (isInView) {
if (!$(this).find('a').attr('style')) {
$(this).find('a').css('background','url('+OC.filePath('contacts', '', 'thumbnail.php')+'?id='+$(this).data('id')+') no-repeat');
}
}
})}, 500);
- setTimeout(Contacts.UI.Contacts.lazyupdate, 500);
+ setTimeout(Contacts.UI.Contacts.lazyupdate, 500);*/
},
// Add thumbnails to the contact list as they become visible in the viewport.
lazyupdate:function(){
@@ -1557,7 +1568,7 @@ $(document).ready(function(){
$('.contacts').click();
}
});
- $(document).on("click", ".contacts",function(event){
+ $(document).on('click', '.contacts', function(event){
var $tgt = $(event.target);
if ($tgt.is('li') || $tgt.is('a')) {
var item = $tgt.is('li')?$($tgt):($tgt).parent();
@@ -1579,6 +1590,11 @@ $(document).ready(function(){
return false;
});
+ $(document).on('click', '.addressbook', function(event){
+ $(this).next().toggle();
+ return false;
+ });
+
$('.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