Skip to content

Commit 6d9abdf

Browse files
committed
allow override of default PaginatedCollection options.
reverse order of _.extend call in PaginatedCollection to allow individual collections to override the add and url options. Change-Id: Ia49e6a549b11023304fbee9e3465cbec3694b48f Reviewed-on: https://gerrit.instructure.com/12676 Tested-by: Jenkins <jenkins@instructure.com> Reviewed-by: Ryan Florence <ryanf@instructure.com>
1 parent f746cb3 commit 6d9abdf

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

app/coffeescripts/collections/PaginatedCollection.coffee

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ define [
77

88
fetchNextPage: (options={}) ->
99
throw new Error "can't fetch next page when @nextPageUrl is undefined" unless @nextPageUrl?
10-
options = _.extend {}, options,
11-
add: true
12-
url: @nextPageUrl
10+
options = _.extend({}, {add: true, url: @nextPageUrl}, options)
1311

1412
@fetchingNextPage = true
1513
@trigger 'beforeFetchNextPage'
@@ -51,4 +49,4 @@ define [
5149

5250
parse: (response, xhr) ->
5351
@_parsePageLinks(xhr)
54-
super
52+
super

0 commit comments

Comments
 (0)