mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-04-05 03:00:15 -04:00
Reserve space for the spotlight box on /r/all to reduce flicker.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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))}
|
||||
|
||||
Reference in New Issue
Block a user