summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorMichael Walker <mike@barrucadu.co.uk>2016-08-21 20:37:09 +0100
committerGitHub <noreply@github.com>2016-08-21 20:37:09 +0100
commit0426ec4011cbd954274718c9339f7bfc3df2ab88 (patch)
tree9c257d584e736f0921025443844c67e1d6dea127 /js
parent0f7039b6005db81cb4232d3a7241e1709305b62f (diff)
Fix rules-popup jquery issue.
Diffstat (limited to 'js')
-rw-r--r--js/rules-popup.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/js/rules-popup.js b/js/rules-popup.js
index 515c5b71..36261b45 100644
--- a/js/rules-popup.js
+++ b/js/rules-popup.js
@@ -12,13 +12,14 @@
*
*/
-if (typeof localStorage.rulesAccepted === "undefined") {
+$(window).ready(function() {
+ if (typeof localStorage.rulesAccepted === "undefined") {
// generate a 7-character long random string
captcha = Math.random().toString(36).substring(2, 9)
- $("<div id='rules-popup'>")
- .prependTo("body");
+ $("body")
+ .prepend("<div id='rules-popup'>");
$("#rules-popup")
.append("<div class='rules-popup-top'>lainchan rule agreement</div>")
@@ -39,4 +40,5 @@ if (typeof localStorage.rulesAccepted === "undefined") {
$(".rules-popup-form")
.append("<input class='rules-popup-form-input' type='text' id='captcha' />")
.append("<input type='submit' value='ACCEPT' />");
-} \ No newline at end of file
+ }
+})