diff options
author | Alfredo Sumaran <alfredo@gitlab.com> | 2016-03-03 15:00:15 -0500 |
---|---|---|
committer | Alfredo Sumaran <alfredo@gitlab.com> | 2016-03-03 15:20:02 -0500 |
commit | 74d41f89507401fd6be028b36999d16a5111f9ab (patch) | |
tree | ca46b12ac040a8511fe2e772efdda6cd15f45740 | |
parent | aaaebd392f313f78d5a95565e749838bedc5625e (diff) | |
download | gitlab-ce-issue_13300.tar.gz |
Use camelCase for variable namesissue_13300
-rw-r--r-- | app/assets/javascripts/notes.js.coffee | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/app/assets/javascripts/notes.js.coffee b/app/assets/javascripts/notes.js.coffee index 8d9be407d97..c95ead22e6c 100644 --- a/app/assets/javascripts/notes.js.coffee +++ b/app/assets/javascripts/notes.js.coffee @@ -16,8 +16,8 @@ class @Notes @view = view @noteable_url = document.URL @notesCountBadge ||= $(".issuable-details").find(".notes-tab .badge") - @base_polling_interval = 15000 - @max_polling_steps = 4 + @basePollingInterval = 15000 + @maxPollingSteps = 4 @cleanBinding() @addBinding() @@ -93,7 +93,7 @@ class @Notes clearInterval(Notes.interval) Notes.interval = setInterval => @refresh() - , @polling_interval + , @pollingInterval refresh: -> return if @refreshing is true @@ -119,19 +119,19 @@ class @Notes @refreshing = false ### - Increase @polling_interval up to 120 seconds on every function call, + Increase @pollingInterval up to 120 seconds on every function call, if `shouldReset` has a truthy value, 'null' or 'undefined' the variable - will reset to @base_polling_interval. + will reset to @basePollingInterval. Note: this function is used to gradually increase the polling interval if there aren't new notes coming from the server ### setPollingInterval: (shouldReset = true) -> - nthInterval = @base_polling_interval * Math.pow(2, @max_polling_steps - 1) + nthInterval = @basePollingInterval * Math.pow(2, @maxPollingSteps - 1) if shouldReset - @polling_interval = @base_polling_interval - else if @polling_interval < nthInterval - @polling_interval *= 2 + @pollingInterval = @basePollingInterval + else if @pollingInterval < nthInterval + @pollingInterval *= 2 @initRefresh() |