Permalink
Browse files

Extended callback and fixed pathParse bug

+ Callback now has second parameter, options
+ pathParse function is executed in '_determinepath'
  • Loading branch information...
1 parent cbf650c commit 67842c3212600f9a54af8d970a167f180d9c2447 @lukeshumard lukeshumard committed Oct 27, 2011
Showing with 5 additions and 3 deletions.
  1. +5 −3 jquery.infinitescroll.js
@@ -3,7 +3,7 @@
Infinite Scroll
--------------------------------
+ https://github.com/paulirish/infinite-scroll
- + version 2.0b2.110713
+ + version 2.0b2.111027
+ Copyright 2011 Paul Irish & Luke Shumard
+ Licensed under the MIT license
@@ -73,6 +73,8 @@
var instance = this,
opts = instance.options;
+
+ opts.v = '2.0b2.111027';
// if behavior is defined and this function is extended, call that instead of default
if (!!opts.behavior && this['_binding_'+opts.behavior] !== undefined) {
@@ -156,7 +158,7 @@
instance['_callback_'+opts.behavior].call($(opts.contentSelector)[0], data);
}
if (callback) {
- callback.call($(opts.contentSelector)[0], data);
+ callback.call($(opts.contentSelector)[0], data, opts);
}
};
@@ -187,7 +189,7 @@
if (!!opts.pathParse) {
this._debug('pathParse manual');
- return opts.pathParse;
+ return opts.pathParse();
} else if (path.match(/^(.*?)\b2\b(.*?$)/)) {
path = path.match(/^(.*?)\b2\b(.*?$)/).slice(1);

0 comments on commit 67842c3

Please sign in to comment.