From 977076e92c118560e32a5803aa26bc974b8d928b Mon Sep 17 00:00:00 2001 From: Max Goodman Date: Sun, 21 Jul 2013 19:39:29 -0700 Subject: [PATCH] Fudge the height of the page for long listing choosers. This is a hack to ensure that the listing chooser is entirely visible on the page until we can improve the positioning/scrolling of the listing chooser sidebar. --- r2/r2/public/static/js/multi.js | 7 ++++ r2/r2/templates/listingchooser.html | 54 +++++++++++++++-------------- 2 files changed, 35 insertions(+), 26 deletions(-) diff --git a/r2/r2/public/static/js/multi.js b/r2/r2/public/static/js/multi.js index 0f9b9d52e..0f70009b2 100644 --- a/r2/r2/public/static/js/multi.js +++ b/r2/r2/public/static/js/multi.js @@ -608,6 +608,13 @@ r.multi.ListingChooser = Backbone.View.extend({ initialize: function() { this.$el.addClass('initialized') + + // HACK: fudge page heights for long lists of multis / short pages + var thisHeight = this.$('.contents').height(), + bodyHeight = $('body').height() + if (thisHeight > bodyHeight) { + $('body').css('padding-bottom', thisHeight - bodyHeight + 100) + } }, createClick: function(ev) { diff --git a/r2/r2/templates/listingchooser.html b/r2/r2/templates/listingchooser.html index 9e297a0a5..ef4412d62 100644 --- a/r2/r2/templates/listingchooser.html +++ b/r2/r2/templates/listingchooser.html @@ -40,32 +40,34 @@
- +
+
    + ${section_items(thing.sections['global'])} +
-

${_('multireddits')}

- %if thing.show_samples: -
-

${_('new! create sets of subreddits to view together.')}

-

${_('for starters, try one of these:')}

-
    - ${section_items(thing.sections['sample'])} -
-
- %endif -
    - ${section_items(thing.sections['multi'])} -
  • -
    - -
    -
    -
    -
  • -
+

${_('multireddits')}

+ %if thing.show_samples: +
+

${_('new! create sets of subreddits to view together.')}

+

${_('for starters, try one of these:')}

+
    + ${section_items(thing.sections['sample'])} +
+
+ %endif +
    + ${section_items(thing.sections['multi'])} +
  • +
    + +
    +
    +
    +
  • +
-
    - ${section_items(thing.sections['other'])} -
+
    + ${section_items(thing.sections['other'])} +
+