From 5f619d3254052cb48fc47bc36e7aaabf9d33ce50 Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 6 Aug 2012 23:10:37 -0700 Subject: the dynamic "show more" sort of works - but with a nagging delay. But I need to move on to bigger things. We'll leave it for now. --- js/main.js | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) (limited to 'js') diff --git a/js/main.js b/js/main.js index 438b7db14..b31261065 100644 --- a/js/main.js +++ b/js/main.js @@ -303,12 +303,43 @@ function updateConvItems(mode,data) { /* autocomplete @nicknames */ $(".comment-edit-form textarea").contact_autocomplete(baseurl+"/acl"); + + var bimgs = $(".wall-item-body > img").not(function() { return this.complete; }); + var bimgcount = bimgs.length; + if (bimgcount) { + bimgs.load(function() { + bimgcount--; + if (! bimgcount) { + collapseHeight(); + + } + }); + } else { + collapseHeight(); + } -} + // $(".wall-item-body").each(function() { + // if(! $(this).hasClass('divmore')) { + // $(this).divgrow({ initialHeight: 400, showBrackets: false }); + // $(this).addClass('divmore'); + // } + //}); + +} + function collapseHeight() { + $(".wall-item-body").each(function() { + if($(this).height() > 410) { + if(! $(this).hasClass('divmore')) { + $(this).divgrow({ initialHeight: 400, showBrackets: false }); + $(this).addClass('divmore'); + } + } + }); + } @@ -737,6 +768,7 @@ jQuery.timeago.settings.strings = { $("abbr.wall-item-ago-time").timeago(); //$("div.wall-item-body").divgrow({ initialHeight: 400 }); +//reCalcHeight(); }); -- cgit v1.2.3