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.
This commit is contained in:
Max Goodman
2013-07-21 19:39:29 -07:00
parent 814ae1e1e0
commit 977076e92c
2 changed files with 35 additions and 26 deletions

View File

@@ -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) {

View File

@@ -40,32 +40,34 @@
<script>r.ui.collapseListingChooser()</script>
<div class="listing-chooser">
<div class="grippy"></div>
<ul class="global">
${section_items(thing.sections['global'])}
</ul>
<div class="contents">
<ul class="global">
${section_items(thing.sections['global'])}
</ul>
<h3>${_('multireddits')}</h3>
%if thing.show_samples:
<div class="intro">
<p>${_('new! create sets of subreddits to view together.')}</p>
<p>${_('for starters, try one of these:')}</p>
<ul class="multis">
${section_items(thing.sections['sample'])}
</ul>
</div>
%endif
<ul class="multis">
${section_items(thing.sections['multi'])}
<li class="create">
<form>
<input type="text" class="multi-name" placeholder="${_('name')}"></input>
<div class="error"></div>
<button>${_('create')}</button><div class="throbber"></div>
</form>
</li>
</ul>
<h3>${_('multireddits')}</h3>
%if thing.show_samples:
<div class="intro">
<p>${_('new! create sets of subreddits to view together.')}</p>
<p>${_('for starters, try one of these:')}</p>
<ul class="multis">
${section_items(thing.sections['sample'])}
</ul>
</div>
%endif
<ul class="multis">
${section_items(thing.sections['multi'])}
<li class="create">
<form>
<input type="text" class="multi-name" placeholder="${_('name')}"></input>
<div class="error"></div>
<button>${_('create')}</button><div class="throbber"></div>
</form>
</li>
</ul>
<ul class="other">
${section_items(thing.sections['other'])}
</ul>
<ul class="other">
${section_items(thing.sections['other'])}
</ul>
</div>
</div>