diff --git a/app/views/javascript/actualize.phtml b/app/views/javascript/actualize.phtml index 6a92e5642..d08dc47d1 100644 --- a/app/views/javascript/actualize.phtml +++ b/app/views/javascript/actualize.phtml @@ -10,7 +10,7 @@ var feeds = [\ - 0 / " + feed_count + "
\ + 0 / " + feed_count + "
\ \ "); } else { @@ -24,7 +24,8 @@ function updateProgressBar(i) { function updateFeeds() { if (feed_count === 0) { - openNotification("", "good"); + openNotification("", "good"); + ajax_loading = false; return; } initProgressBar(true); @@ -39,6 +40,7 @@ function updateFeed() { if (feed == undefined) { return; } + $.ajax({ type: 'POST', url: feed, diff --git a/p/scripts/main.js b/p/scripts/main.js index 54ee7f0fd..243159ca5 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -1,7 +1,8 @@ "use strict"; var $stream = null, isCollapsed = true, - shares = 0; + shares = 0, + ajax_loading = false; function is_normal_mode() { return $stream.hasClass('normal'); @@ -684,14 +685,22 @@ function init_actualize() { var auto = false; $("#actualize").click(function () { + if (ajax_loading) { + return false; + } + + ajax_loading = true; + $.getScript('./?c=javascript&a=actualize').done(function () { if (auto && feed_count < 1) { auto = false; - return; + ajax_loading = false; + return false; } updateFeeds(); }); + return false; });