Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add class to the top bar random button for breadcrumb tracking.

  • Loading branch information...
commit d77c53fa4405bf74b9f27a6d951a024604427ac6 1 parent 0a70249
Max Goodman authored spladug committed
Showing with 5 additions and 3 deletions.
  1. +2 −2 r2/r2/lib/menus.py
  2. +3 −1 r2/r2/lib/pages/pages.py
View
4 r2/r2/lib/menus.py
@@ -339,11 +339,11 @@ class SubredditButton(NavButton):
# TRANSLATORS: This refers to the user's front page
Frontpage: _("front")}
- def __init__(self, sr):
+ def __init__(self, sr, **kw):
self.path = sr.path
name = self.name_overrides.get(sr, sr.name)
NavButton.__init__(self, name, sr.path, False,
- isselected = (c.site == sr))
+ isselected = (c.site == sr), **kw)
def build(self, base_path = ''):
pass
View
4 r2/r2/lib/pages/pages.py
@@ -1454,6 +1454,7 @@ def popular_reddits(self, exclude=[]):
css_class = 'sr-bar', _id = 'sr-bar')
def special_reddits(self):
+ css_classes = {Random: "random"}
reddits = [Frontpage, All, Random]
if getattr(c.site, "over_18", False):
reddits.append(RandomNSFW)
@@ -1462,7 +1463,8 @@ def special_reddits(self):
reddits.append(Friends)
if c.show_mod_mail:
reddits.append(Mod)
- return NavMenu([SubredditButton(sr) for sr in reddits],
+ return NavMenu([SubredditButton(sr, css_class=css_classes.get(sr))
+ for sr in reddits],
type = 'flatlist', separator = '-',
css_class = 'sr-bar')
Please sign in to comment.
Something went wrong with that request. Please try again.