Commit 2783877e authored by Alfredo Sumaran's avatar Alfredo Sumaran

Move declarations

parent 153afd0c
......@@ -73,14 +73,10 @@ class @Todos
getTodosPerPage: ->
@el.data('perPage')
redirectIfNeeded: (total) ->
currPages = @getTotalPages()
currPage = @getCurrentPage()
newPages = Math.ceil(total / @getTodosPerPage())
url = location.href # Includes query strings
# Refresh if no remaining Todos
if not total
location.reload()
......@@ -89,6 +85,9 @@ class @Todos
# Do nothing if no pagination
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 newPages isnt currPages
# Redirect to previous page if there's one available
......
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