diff options
author | friendica <info@friendica.com> | 2014-11-16 19:33:58 -0800 |
---|---|---|
committer | friendica <info@friendica.com> | 2014-11-16 19:33:58 -0800 |
commit | acc8c692421581c2516bbe5d91d86ad2f3f12c27 (patch) | |
tree | a1a00a8f341cfd33df7e875dc7e874f10a21a952 /view/js/main.js | |
parent | 591f10e2350812d1aa8d673246d59bfa3063c051 (diff) | |
download | volse-hubzilla-acc8c692421581c2516bbe5d91d86ad2f3f12c27.tar.gz volse-hubzilla-acc8c692421581c2516bbe5d91d86ad2f3f12c27.tar.bz2 volse-hubzilla-acc8c692421581c2516bbe5d91d86ad2f3f12c27.zip |
when in list mode, make the max height half of the normal height before 'divgrow' kicks in.
Diffstat (limited to 'view/js/main.js')
-rw-r--r-- | view/js/main.js | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/view/js/main.js b/view/js/main.js index a55b8fbb1..bec35ba72 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -458,25 +458,17 @@ function updateConvItems(mode,data) { if(isVisible) showHideComments(itmId); $(".autotime").timeago(); - // divgrow doesn't prevent itself from attaching a second (or 500th) - // "show more" div to a content region - it also has a few other - // issues related to how we're trying to use it. - // disable for now. - // $("div.wall-item-body").divgrow({ initialHeight: 400 }); } else { $('img',this).each(function() { $(this).attr('src',$(this).attr('dst')); }); - // more FIXME related to expanded comments if($('#collapsed-comments-'+itmId).is(':visible')) isVisible = true; $('#' + ident).replaceWith($(this)); if(isVisible) showHideComments(itmId); $(".autotime").timeago(); - // $("div.wall-item-body").divgrow({ initialHeight: 400 }); - } prev = ident; }); @@ -508,8 +500,6 @@ function updateConvItems(mode,data) { if(isVisible) showHideComments(itmId); $(".autotime").timeago(); - // $("div.wall-item-body").divgrow({ initialHeight: 400 }); - } else { $('img',this).each(function() { @@ -521,7 +511,6 @@ function updateConvItems(mode,data) { if(isVisible) showHideComments(itmId); $(".autotime").timeago(); - // $("div.wall-item-body").divgrow({ initialHeight: 400 }); } }); @@ -557,7 +546,6 @@ function updateConvItems(mode,data) { showHideComments(itmId); $(".autotime").timeago(); - // $("div.wall-item-body").divgrow({ initialHeight: 400 }); } prev = ident; }); @@ -596,17 +584,28 @@ function updateConvItems(mode,data) { function collapseHeight() { - $(".wall-item-body").each(function() { - if($(this).height() > 410) { + var isListMode = false; + $(".wall-item-listbody").each(function() { + isListMode = true; + if($(this).height() > 210) { if(! $(this).hasClass('divmore')) { - $(this).divgrow({ initialHeight: 400, moreText: aStr['divgrowmore'], lessText: aStr['divgrowless'], showBrackets: false }); + $(this).divgrow({ initialHeight: 200, moreText: aStr['divgrowmore'], lessText: aStr['divgrowless'], showBrackets: false }); $(this).addClass('divmore'); } } }); - } - + $(".wall-item-body").each(function() { + if(! isListMode) { + if($(this).height() > 410) { + if(! $(this).hasClass('divmore')) { + $(this).divgrow({ initialHeight: 400, moreText: aStr['divgrowmore'], lessText: aStr['divgrowless'], showBrackets: false }); + $(this).addClass('divmore'); + } + } + } + }); + } function liveUpdate() { if((src == null) || (stopped) || (! profile_uid)) { $('.like-rotator').spin(false); return; } |