From 3c9ed94773d4c050eada6d6924ae6c80f27f5a9a Mon Sep 17 00:00:00 2001 From: Adam Pritchard Date: Sun, 23 Jun 2013 07:49:41 -0400 Subject: [PATCH] Fixed bug #77: Sometimes options page MD preview doesn't initially render. Also copied a bit of code from the css-update branch --- src/common/default.css | 2 +- src/common/options.html | 8 ++++---- src/common/options.js | 21 ++++++++++++++++----- src/common/test/index.html | 11 ++++++++--- 4 files changed, 29 insertions(+), 13 deletions(-) diff --git a/src/common/default.css b/src/common/default.css index a33a4ad1..af69e348 100644 --- a/src/common/default.css +++ b/src/common/default.css @@ -34,7 +34,7 @@ pre { pre code { white-space: pre; - overflow: auto; + overflow: auto; /* fixes issue #70: Firefox/Thunderbird: Code blocks with horizontal scroll would have bad background colour */ border-radius: 3px; border: 1px solid #CCC; padding: 0.5em 0.7em; diff --git a/src/common/options.html b/src/common/options.html index 14b0e3d2..018b5680 100644 --- a/src/common/options.html +++ b/src/common/options.html @@ -1,11 +1,11 @@ + + - - - + diff --git a/src/common/options.js b/src/common/options.js index 49098284..37ee36b9 100644 --- a/src/common/options.js +++ b/src/common/options.js @@ -1,5 +1,5 @@ /* - * Copyright Adam Pritchard 2012 + * Copyright Adam Pritchard 2013 * MIT License : http://adampritchard.mit-license.org/ */ @@ -12,7 +12,8 @@ */ var cssEdit, cssSyntaxEdit, cssSyntaxSelect, rawMarkdownIframe, savedMsg, - mathEnable, mathEdit, hotkeyShift, hotkeyCtrl, hotkeyAlt, hotkeyKey; + mathEnable, mathEdit, hotkeyShift, hotkeyCtrl, hotkeyAlt, hotkeyKey, + loaded = false; function onLoad() { var xhr; @@ -125,15 +126,25 @@ function onLoad() { } }; xhr.send(); + + loaded = true; } document.addEventListener('DOMContentLoaded', onLoad, false); // The Preview