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
2783877e
Commit
2783877e
authored
Apr 13, 2016
by
Alfredo Sumaran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move declarations
parent
153afd0c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
4 deletions
+3
-4
app/assets/javascripts/todos.js.coffee
app/assets/javascripts/todos.js.coffee
+3
-4
No files found.
app/assets/javascripts/todos.js.coffee
View file @
2783877e
...
@@ -73,14 +73,10 @@ class @Todos
...
@@ -73,14 +73,10 @@ class @Todos
getTodosPerPage
:
->
getTodosPerPage
:
->
@
el
.
data
(
'perPage'
)
@
el
.
data
(
'perPage'
)
redirectIfNeeded
:
(
total
)
->
redirectIfNeeded
:
(
total
)
->
currPages
=
@
getTotalPages
()
currPages
=
@
getTotalPages
()
currPage
=
@
getCurrentPage
()
currPage
=
@
getCurrentPage
()
newPages
=
Math
.
ceil
(
total
/
@
getTodosPerPage
())
url
=
location
.
href
# Includes query strings
# Refresh if no remaining Todos
# Refresh if no remaining Todos
if
not
total
if
not
total
location
.
reload
()
location
.
reload
()
...
@@ -89,6 +85,9 @@ class @Todos
...
@@ -89,6 +85,9 @@ class @Todos
# Do nothing if no pagination
# Do nothing if no pagination
return
if
not
currPages
return
if
not
currPages
newPages
=
Math
.
ceil
(
total
/
@
getTodosPerPage
())
url
=
location
.
href
# Includes query strings
# If new total of pages is different than we have now
# If new total of pages is different than we have now
if
newPages
isnt
currPages
if
newPages
isnt
currPages
# Redirect to previous page if there's one available
# Redirect to previous page if there's one available
...
...
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