Commit 74d41f89 authored by Alfredo Sumaran's avatar Alfredo Sumaran

Use camelCase for variable names

parent aaaebd39
...@@ -16,8 +16,8 @@ class @Notes ...@@ -16,8 +16,8 @@ class @Notes
@view = view @view = view
@noteable_url = document.URL @noteable_url = document.URL
@notesCountBadge ||= $(".issuable-details").find(".notes-tab .badge") @notesCountBadge ||= $(".issuable-details").find(".notes-tab .badge")
@base_polling_interval = 15000 @basePollingInterval = 15000
@max_polling_steps = 4 @maxPollingSteps = 4
@cleanBinding() @cleanBinding()
@addBinding() @addBinding()
...@@ -93,7 +93,7 @@ class @Notes ...@@ -93,7 +93,7 @@ class @Notes
clearInterval(Notes.interval) clearInterval(Notes.interval)
Notes.interval = setInterval => Notes.interval = setInterval =>
@refresh() @refresh()
, @polling_interval , @pollingInterval
refresh: -> refresh: ->
return if @refreshing is true return if @refreshing is true
...@@ -119,19 +119,19 @@ class @Notes ...@@ -119,19 +119,19 @@ class @Notes
@refreshing = false @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 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 Note: this function is used to gradually increase the polling interval
if there aren't new notes coming from the server if there aren't new notes coming from the server
### ###
setPollingInterval: (shouldReset = true) -> setPollingInterval: (shouldReset = true) ->
nthInterval = @base_polling_interval * Math.pow(2, @max_polling_steps - 1) nthInterval = @basePollingInterval * Math.pow(2, @maxPollingSteps - 1)
if shouldReset if shouldReset
@polling_interval = @base_polling_interval @pollingInterval = @basePollingInterval
else if @polling_interval < nthInterval else if @pollingInterval < nthInterval
@polling_interval *= 2 @pollingInterval *= 2
@initRefresh() @initRefresh()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment