From 021003ca949dae1f70508ce4a4797711ec5aef71 Mon Sep 17 00:00:00 2001 From: Mayhem Date: Fri, 29 Apr 2011 17:30:12 +0200 Subject: [PATCH] Set timer to 0 on manual update. --- 4chan_x.js | 6 +++++- script.coffee | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/4chan_x.js b/4chan_x.js index 9acb54092..9cebc826b 100644 --- a/4chan_x.js +++ b/4chan_x.js @@ -1298,7 +1298,7 @@ updNow = $('input[type=button]', dialog); $.bind(verbose, 'click', updater.cb.verbose); $.bind(autoUpT, 'click', updater.cb.autoUpdate); - $.bind(updNow, 'click', updater.update); + $.bind(updNow, 'click', updater.updateNow); $.append(d.body, dialog); updater.cb.verbose.call(verbose); return updater.cb.autoUpdate.call(autoUpT); @@ -1387,6 +1387,10 @@ return updater.update(); } }, + updateNow: function() { + $('#timer').textContent = 0; + return updater.update(); + }, update: function() { var cb, url, _ref; if ((_ref = updater.request) != null) { diff --git a/script.coffee b/script.coffee index cdef030d0..6e0ea8b44 100644 --- a/script.coffee +++ b/script.coffee @@ -1019,7 +1019,7 @@ updater = updNow = $ 'input[type=button]', dialog $.bind verbose, 'click', updater.cb.verbose $.bind autoUpT, 'click', updater.cb.autoUpdate - $.bind updNow, 'click', updater.update + $.bind updNow, 'click', updater.updateNow $.append d.body, dialog @@ -1097,6 +1097,10 @@ updater = if n == 0 updater.update() + updateNow: -> + $('#timer').textContent = 0 + updater.update() + update: -> updater.request?.abort() url = location.href + '?' + Date.now() # fool the cache