diff --git a/js/interface_home.js b/js/interface_home.js index 5c930d6..f386194 100644 --- a/js/interface_home.js +++ b/js/interface_home.js @@ -13,34 +13,32 @@ var InterfaceFunctions = function() //faço os binds no init this.init = function() { + var theme = $.Options.getTheme(); + $( ".wrapper .postboard-news").click(function() { requestTimelineUpdate("latest",postsPerRefresh,followingUsers,promotedPostsOnly);}); - - /*$( ".promoted-posts-only").click(function() { - promotedPostsOnly = !promotedPostsOnly; - $(this).text( promotedPostsOnly ? "Switch to Normal posts" : "Switch to Promoted posts" ); - timelineChangedUser(); - $.MAL.getStreamPostsParent().empty(); - requestTimelineUpdate("latestFirstTime",postsPerRefresh,followingUsers,promotedPostsOnly); - });*/ - - // Add refresh posts for home link in menu $( ".userMenu-home.current a").click(function() { requestTimelineUpdate("latest",postsPerRefresh,followingUsers,promotedPostsOnly);}); - // modified the way promoted posts are shown - $( ".promoted-posts-only").click(function() { + $( ".promoted-posts-only").click(function() { promotedPostsOnly = !promotedPostsOnly; - //active promoted posts tab - $(this).children('.promoted-posts').addClass(promotedPostsOnly ? "active" : "disabled"); - $(this).children('.normal-posts').addClass(promotedPostsOnly ? "disabled" : "active"); - $('#postboard-top').removeClass(promotedPostsOnly ? "show" : "hide"); - //active normal posts - $(this).children('.promoted-posts').removeClass(promotedPostsOnly ? "disabled" : "active"); - $(this).children('.normal-posts').removeClass(promotedPostsOnly ? "active" : "disabled"); - $('#postboard-top').addClass(promotedPostsOnly ? "hide" : "show"); + + if(theme == 'nin') + { + // modify the way promoted posts are shown + //active promoted posts tab + $(this).children('.promoted-posts').addClass(promotedPostsOnly ? "active" : "disabled"); + $(this).children('.normal-posts').addClass(promotedPostsOnly ? "disabled" : "active"); + $('#postboard-top').removeClass(promotedPostsOnly ? "show" : "hide"); + //active normal posts + $(this).children('.promoted-posts').removeClass(promotedPostsOnly ? "disabled" : "active"); + $(this).children('.normal-posts').removeClass(promotedPostsOnly ? "active" : "disabled"); + $('#postboard-top').addClass(promotedPostsOnly ? "hide" : "show"); + } else { + $(this).text( promotedPostsOnly ? polyglot.t('Switch to Normal posts') : polyglot.t('Switch to Promoted posts') ); + } timelineChangedUser(); $.MAL.getStreamPostsParent().empty();