Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2016-06-13 23:23:38 +0300
committerRobert Speicher <rspeicher@gmail.com>2016-06-13 23:23:38 +0300
commite20aa4581b0d17eae36d9722ee8789af47f57727 (patch)
tree36c4cbf3ce74b229dd5eacf06e2cb99f79870996 /app/assets/javascripts
parent6aefd3c3213277d80e0680809b45643ef19df4d0 (diff)
Fix note polling when a window has been hidden
`refresh` was called, `refreshing` was set to true, but then because `document.hidden` was true, `getContent` was never called, and `refreshing` never got reset to `false`, which stopped polling entirely until refresh.
Diffstat (limited to 'app/assets/javascripts')
-rw-r--r--app/assets/javascripts/notes.js.coffee6
1 files changed, 4 insertions, 2 deletions
diff --git a/app/assets/javascripts/notes.js.coffee b/app/assets/javascripts/notes.js.coffee
index ad216910c8d..e2d3241437b 100644
--- a/app/assets/javascripts/notes.js.coffee
+++ b/app/assets/javascripts/notes.js.coffee
@@ -115,12 +115,14 @@ class @Notes
, @pollingInterval
refresh: =>
- return if @refreshing is true
- @refreshing = true
if not document.hidden and document.URL.indexOf(@noteable_url) is 0
@getContent()
getContent: ->
+ return if @refreshing
+
+ @refreshing = true
+
$.ajax
url: @notes_url
data: "last_fetched_at=" + @last_fetched_at