From 7933186018876cd2af917c4e119e14fb393e34c2 Mon Sep 17 00:00:00 2001 From: Simon Grim Date: Sun, 27 Nov 2016 17:31:39 +0500 Subject: [PATCH] make testRightSide() agnostic to which modules are exist --- js/theme_option.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/js/theme_option.js b/js/theme_option.js index 067102d..73e262e 100644 --- a/js/theme_option.js +++ b/js/theme_option.js @@ -61,13 +61,14 @@ $(document).ready(function() }); function testRightSide() { // if rightside is empty, don't show it and engarge postboard - if( ( $('.toptrends').html() == '' ) && ($('.who-to-follow').html() == '') && ( $('.twistday-reminder').html() == '' ) ){ - $('.dashboard.right').css('display: none'); - $('.wrapper .postboard').addClass('large'); - } - else { - $('.dashboard.right').css('display: block'); + var container = $('.dashboard.right'); + + if (container.children('.module:not(:empty)').length) { + container.show(); $('.wrapper .postboard').removeClass('large'); + } else { + container.hide(); + $('.wrapper .postboard').addClass('large'); } }