fredwu / jquery-endless-scroll

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

Configurable parameter insertAfter and insertBefore overriden by default #43

Open pp-surbhigupta opened 10 years ago

pp-surbhigupta commented 10 years ago

When integrating the Plugin, I faced an issue that my content was not getting replaced at the position mentioned in the configuration

$('#scrollableList').endlessScroll({ fireOnce: false, inflowPixels: 1, insertAfter: '#scrollableList div:last', insertBefore: '#scrollableList div:last', loader: '' });

insertAfter and insertBefore were overriden in the function EndlessScroll.prototype.setInsertPositionsWhenNecessary since we are using default to check if insertAfter and insertBefore are provided. We should be checking for options.insertAfter and options.insertBefor