From fdf9f77eb77c26de588a9f212381e33d9a248a31 Mon Sep 17 00:00:00 2001 From: Kirushna Date: Tue, 21 Jun 2016 13:27:45 +0530 Subject: [PATCH] Fix for night mode not persisting in pages other than challenges jq fix Fix for night mode not persisting in pages other than challenges Fix for night mode - chat --- client/main.js | 10 +++++++++- server/views/layout-wide.jade | 2 +- server/views/layout.jade | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/client/main.js b/client/main.js index 4f868452d7..c1a469d3e1 100644 --- a/client/main.js +++ b/client/main.js @@ -87,7 +87,9 @@ main = (function(main, global) { return null; } mainChatTitleAdded = true; - + if ($('body').hasClass('night')) { + $('#chat-embed-main').addClass('night'); + } $('#chat-embed-main > .gitter-chat-embed-action-bar').prepend( '
' + 'Free Code Camp\'s Main Chat' + @@ -302,6 +304,9 @@ $(document).ready(function() { frameBorder: '0' }); $('.map-aside').append(mapAside); + if ($('body').hasClass('night')) { + mapAside.addClass('night'); + } main.isMapAsideLoad = true; } $('.map-aside').removeClass('is-collapsed'); @@ -369,6 +374,9 @@ $(document).ready(function() { }); $('.wiki-aside').append(wikiAside); main.isWikiAsideLoad = true; + if ($('body').hasClass('night')) { + wikiAside.addClass('night'); + } } $('.wiki-aside').removeClass('is-collapsed'); } diff --git a/server/views/layout-wide.jade b/server/views/layout-wide.jade index cf548c3edc..8484936c90 100644 --- a/server/views/layout-wide.jade +++ b/server/views/layout-wide.jade @@ -4,7 +4,7 @@ html(lang='en') include partials/meta include partials/stylesheets if showAside - body.map-aside-body + body.map-aside-body(class=theme !== 'default' ? theme : '') include partials/scripts block content else diff --git a/server/views/layout.jade b/server/views/layout.jade index eefd4090e0..ca093688e5 100644 --- a/server/views/layout.jade +++ b/server/views/layout.jade @@ -3,7 +3,7 @@ html(lang='en') head include partials/meta include partials/stylesheets - body.top-and-bottom-margins + body.top-and-bottom-margins(class=theme !== 'default' ? theme : '') include partials/scripts include partials/navbar include partials/flash