diff --git a/static/quiz_item.coffee b/static/quiz_item.coffee index fba391d..cce90a6 100644 --- a/static/quiz_item.coffee +++ b/static/quiz_item.coffee @@ -67,11 +67,17 @@ $("#get-help").click (e) -> $("#api-refresh").click (e) -> e.preventDefault(); - $.post("/refresh").success(() -> refreshQuestion()).fail(() -> $('#error-area').show()); + $.post("/refresh").success(() -> + refreshQuestion() + $('#success-area').show() + ).fail(() -> $('#error-area').show()); $('#error-area').find('button').click () -> $('#error-area').hide() +$('#success-area').find('button').click () -> + $('#success-area').hide() + $ -> $(document).ready -> $('[data-toggle="tooltip"]').tooltip(); diff --git a/static/quiz_item.js b/static/quiz_item.js index e728441..ae65179 100644 --- a/static/quiz_item.js +++ b/static/quiz_item.js @@ -91,7 +91,8 @@ $("#api-refresh").click(function(e) { e.preventDefault(); return $.post("/refresh").success(function() { - return refreshQuestion(); + refreshQuestion(); + return $('#success-area').show(); }).fail(function() { return $('#error-area').show(); }); @@ -101,6 +102,10 @@ return $('#error-area').hide(); }); + $('#success-area').find('button').click(function() { + return $('#success-area').hide(); + }); + $(function() { return $(document).ready(function() { $('[data-toggle="tooltip"]').tooltip(); diff --git a/templates/quiz.html b/templates/quiz.html index a4b7dd2..fa43a15 100644 --- a/templates/quiz.html +++ b/templates/quiz.html @@ -30,7 +30,11 @@
+ Cannot refresh API. Try again later. +
+