From ea13ece8901519d6a0f765eb573b75a2f13aa4c1 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 24 Jul 2012 21:03:15 -0700 Subject: rev update --- js/main.js | 69 ++++++++++++++++++++++++++++++-------------------------------- 1 file changed, 33 insertions(+), 36 deletions(-) (limited to 'js/main.js') diff --git a/js/main.js b/js/main.js index 47ce61704..29af7eb59 100644 --- a/js/main.js +++ b/js/main.js @@ -260,6 +260,10 @@ function updateConvItems(mode,data) { } if(mode === 'replace') { // clear existing content + $('.thread-wrapper').remove(); + + prev = 'threads-begin'; + $('.thread-wrapper',data).each(function() { var ident = $(this).attr('id'); @@ -677,42 +681,6 @@ function previewTheme(elm) { } -// This can be used for dynamic "show more" based purely on the -// height of the enclosed HTML (which has overflow: hidden). -// if ($(el).vScrollable()) { -// show_more_link(el); -// } -// when link is clicked do $(el).css('overflow','visible') -// -// We do this by cloning the element in question but in a hidden div which displays overflow content and compare the heights -// of the two elements. Then we remove the hidden div we just created. - -(function($) { - $.fn.vScrollable = function() { - return this.each(function() { - var el = $(this); - var tooHigh = false; - - if(el.css("overflow") == "hidden") { - var text = el.html(); - var t = $(this.cloneNode(true)) - .hide() - .css('position', 'absolute') - .css('overflow', 'visible') - .width(el.width()) - .height('auto') - ; - el.after(t); - tooHigh = (t.height() > el.height()); - el.parentNode.removeChild(el); - } - return tooHigh; - }); - }; -})(jQuery); - - - $(document).ready(function() { jQuery.timeago.settings.strings = { @@ -735,6 +703,35 @@ jQuery.timeago.settings.strings = { numbers: tago17 }; +//$('.wall-item-content').each(function() { + +// var totalHeight = 0; +// $(this).children().each(function(){ +// totalHeight += $(this).outerHeight(true); // true = include margins +// }); +// if(totalHeight > 400) { +// $(this).css({'overflow-y':'hidden','max-height' : '400px'}); + +// } +// else { +// $(this).css('overflow-y','visible'); +// } +// }); + + +$('.wall-item-content').css({'overflow-y':'hidden','max-height' : '400px'}); + +$('.wall-item-content').focus( + function() { + $(this).css('overflow-y','visible') + }); + +$('.wall-item-content').focusout( + function() { + $(this).css( { 'overflow-y' : 'hidden','max-height' : '400px'}); + } +); + $("abbr.wall-item-ago-time").timeago(); }); \ No newline at end of file -- cgit v1.2.3