Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
74d41f89
Commit
74d41f89
authored
Mar 03, 2016
by
Alfredo Sumaran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use camelCase for variable names
parent
aaaebd39
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
app/assets/javascripts/notes.js.coffee
app/assets/javascripts/notes.js.coffee
+9
-9
No files found.
app/assets/javascripts/notes.js.coffee
View file @
74d41f89
...
...
@@ -16,8 +16,8 @@ class @Notes
@
view
=
view
@
noteable_url
=
document
.
URL
@
notesCountBadge
||=
$
(
".issuable-details"
).
find
(
".notes-tab .badge"
)
@
base
_polling_i
nterval
=
15000
@
max
_polling_s
teps
=
4
@
base
PollingI
nterval
=
15000
@
max
PollingS
teps
=
4
@
cleanBinding
()
@
addBinding
()
...
...
@@ -93,7 +93,7 @@ class @Notes
clearInterval
(
Notes
.
interval
)
Notes
.
interval
=
setInterval
=>
@
refresh
()
,
@
polling
_i
nterval
,
@
polling
I
nterval
refresh
:
->
return
if
@
refreshing
is
true
...
...
@@ -119,19 +119,19 @@ class @Notes
@
refreshing
=
false
###
Increase @polling
_i
nterval up to 120 seconds on every function call,
Increase @polling
I
nterval up to 120 seconds on every function call,
if `shouldReset` has a truthy value, 'null' or 'undefined' the variable
will reset to @base
_polling_i
nterval.
will reset to @base
PollingI
nterval.
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_s
teps
-
1
)
nthInterval
=
@
base
PollingInterval
*
Math
.
pow
(
2
,
@
maxPollingS
teps
-
1
)
if
shouldReset
@
polling
_interval
=
@
base_polling_i
nterval
else
if
@
polling
_i
nterval
<
nthInterval
@
polling
_i
nterval
*=
2
@
polling
Interval
=
@
basePollingI
nterval
else
if
@
polling
I
nterval
<
nthInterval
@
polling
I
nterval
*=
2
@
initRefresh
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment