From 26d6fba089f525505be4ee751fd8a4d37961cad0 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sun, 3 Feb 2013 13:29:13 -0600 Subject: Fix spacing issues in signoffs 'Show More' links When we had a simple multi-line message here, we would end up with too much spacing wherever the link had planted itself due to the div adding visual whitespace. Remove the div completely when the link is clicked to remedy this. Signed-off-by: Dan McGee --- sitestatic/archweb.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'sitestatic') diff --git a/sitestatic/archweb.js b/sitestatic/archweb.js index 4a02fb63..dda22d9e 100644 --- a/sitestatic/archweb.js +++ b/sitestatic/archweb.js @@ -451,15 +451,17 @@ function collapseNotes(elements) { return; } contents.slice(maxElements).wrapAll('
'); - ele.append('
Show More…'); + ele.append('Show More…'); // add link and wire it up to show the hidden items ele.find('a.morelink').click(function(event) { event.preventDefault(); - ele.find('div.hide').show(); $(this).remove(); - // remove trailing line break between text and our link - $(this).contents().last().filter('br').remove(); + ele.find('br.morelink-spacer').remove(); + // move the div contents back and delete the empty div + var hidden = ele.find('div.hide'); + hidden.contents().appendTo(ele); + hidden.remove(); }); }); } -- cgit v1.2.3-55-g3dc8