diff options
author | Dan McGee <dan@archlinux.org> | 2013-02-03 13:29:13 -0600 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2013-02-03 13:38:39 -0600 |
commit | 26d6fba089f525505be4ee751fd8a4d37961cad0 (patch) | |
tree | 33bf6f46fd102462e8dccab246544d78357a06ec /sitestatic | |
parent | b82c7b6a3a0f5b42990ec017bf91e66f71f9bfe2 (diff) |
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 <dan@archlinux.org>
Diffstat (limited to 'sitestatic')
-rw-r--r-- | sitestatic/archweb.js | 10 |
1 files changed, 6 insertions, 4 deletions
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('<div class="hide"/>'); - ele.append('<br/><a class="morelink" href="#">Show More…</a>'); + ele.append('<br class="morelink-spacer"/><a class="morelink" href="#">Show More…</a>'); // 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(); }); }); } |