summaryrefslogtreecommitdiffstats
path: root/sitestatic
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2013-02-03 20:29:13 +0100
committerDan McGee <dan@archlinux.org>2013-02-03 20:38:39 +0100
commit26d6fba089f525505be4ee751fd8a4d37961cad0 (patch)
tree33bf6f46fd102462e8dccab246544d78357a06ec /sitestatic
parentb82c7b6a3a0f5b42990ec017bf91e66f71f9bfe2 (diff)
downloadarchweb-26d6fba089f525505be4ee751fd8a4d37961cad0.tar.gz
archweb-26d6fba089f525505be4ee751fd8a4d37961cad0.tar.xz
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.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/sitestatic/archweb.js b/sitestatic/archweb.js
index 4a02fb6..dda22d9 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();
});
});
}