From 8413909a28396e36574365d8ff04dfc6d0daceb4 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Wed, 24 Nov 2010 09:59:48 -0800 Subject: [PATCH] avoid the flash of unstyled content. --- doc-src/assets/javascripts/site.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/doc-src/assets/javascripts/site.js b/doc-src/assets/javascripts/site.js index 0a100201..664e9e59 100644 --- a/doc-src/assets/javascripts/site.js +++ b/doc-src/assets/javascripts/site.js @@ -11,7 +11,7 @@ function changeTheme(theme) { } function changeSyntax(syntax) { - el = $('body'); + el = $('html'); if (!syntax) { syntax = el.hasClass('scss') ? 'sass': 'scss'; @@ -56,6 +56,9 @@ function getSyntaxPreference(defaultSyntax) { } +getThemePreference('dark'); +getSyntaxPreference('scss'); + $('document').ready(function(){ $('#page').click(function(event){ var target = $(event.target); @@ -70,6 +73,4 @@ $('document').ready(function(){ event.preventDefault(); } }); - getThemePreference('dark'); - getSyntaxPreference('scss'); }) \ No newline at end of file