Skip to content
Browse files

Toggle the body element's 'subscriber' class when subscribing/unsubsc…

…ribing from a subreddit.
  • Loading branch information...
1 parent 77f9c25 commit 8b18a1ea44a8aa17e5f922a19d26018f5115a377 @DEADB33F committed
Showing with 4 additions and 0 deletions.
  1. +4 −0 r2/r2/public/static/js/reddit.js
View
4 r2/r2/public/static/js/reddit.js
@@ -325,6 +325,8 @@ function linkstatus(form) {
function subscribe(reddit_name) {
return function() {
if (reddit.logged) {
+ if (reddit.cur_site == reddit_name )
+ $('body').addClass('subscriber');
$.things(reddit_name).find(".entry").addClass("likes");
$.request("subscribe", {sr: reddit_name, action: "sub"});
}
@@ -334,6 +336,8 @@ function subscribe(reddit_name) {
function unsubscribe(reddit_name) {
return function() {
if (reddit.logged) {
+ if (reddit.cur_site == reddit_name )
+ $('body').removeClass('subscriber');
$.things(reddit_name).find(".entry").removeClass("likes");
$.request("subscribe", {sr: reddit_name, action: "unsub"});
}

0 comments on commit 8b18a1e

Please sign in to comment.
Something went wrong with that request. Please try again.