fredwu / jquery-endless-scroll

Endless/infinite scrolling/pagination.
http://fredwu.github.com/jquery-endless-scroll/
837 stars 176 forks source link

refactor default options merge to avert side effects. #9

Closed jonstorer closed 12 years ago

jonstorer commented 12 years ago

setting options this way:

$.extend(defaults, options);

will overwrite the default variable with the param options.

For example, If there are two endless scrolls on the page, the 2nd endless scroll could receive 'dirty' defaults from the first call.

This:

$.extend({}, defaults, options);

won't do that. It keeps defaults clean and separate from the intended options.

fredwu commented 12 years ago

Merged and tagged a new release! Thanks! :)

jonstorer commented 12 years ago

welcome!