Reserve space for the spotlight box on /r/all to reduce flicker.

This commit is contained in:
Max Goodman
2013-10-29 17:43:47 -07:00
parent f1e9c1d1a3
commit 7fd33a2a97
3 changed files with 8 additions and 3 deletions

View File

@@ -24,6 +24,7 @@ from account import *
from link import *
from vote import *
from report import *
from subreddit import DefaultSR, AllSR
from pylons import i18n, request, g
from r2.lib.wrapped import Wrapped
@@ -150,6 +151,7 @@ class SpotlightListing(Listing):
self.srnames = '+'.join(srnames)
self.navigable = kw.get('navigable', True)
self.things = kw.get('organic_links', [])
self.show_placeholder = isinstance(c.site, (DefaultSR, AllSR))
def get_items(self):
from r2.lib.template_helpers import replace_render

View File

@@ -1237,7 +1237,7 @@ a.author { margin-right: 0.5em; }
}
}
body.front-page .organic-listing.loading {
.organic-listing.show-placeholder.loading {
display: block;
height: @min-uncompressed-height;
&.compressed {

View File

@@ -21,7 +21,7 @@
###############################################################################
<%namespace file="printablebuttons.html" import="ynbutton"/>
<%namespace file="utils.html" import="tags, text_with_links"/>
<%namespace file="utils.html" import="tags, text_with_links, classes"/>
<%
import json
from r2.lib.template_helpers import static
@@ -32,7 +32,10 @@
from babel.numbers import format_currency
%>
<div id="siteTable_organic" class="organic-listing loading${' compressed' if thing.compress_display else ''}">
<div id="siteTable_organic" ${classes('organic-listing', 'loading',
'compressed' if thing.compress_display else None,
'show-placeholder' if thing.show_placeholder else None,
)}>
%if thing.things:
%for link in thing.things:
${unsafe(link.render(display=False))}