mirror of
https://github.com/twisterarmy/twister-html.git
synced 2025-03-12 05:21:18 +00:00
fix switch-to-normal/promoted-posts to be compatible with different themes. add polyglot.t() to strings
This commit is contained in:
parent
c474b98b1d
commit
0c1dbae4e6
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user