Move declarations
This commit is contained in:
parent
153afd0cd4
commit
2783877e86
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue