File tree Expand file tree Collapse file tree 8 files changed +62
-11
lines changed Expand file tree Collapse file tree 8 files changed +62
-11
lines changed Original file line number Diff line number Diff line change 1
1
Changelog
2
2
=========
3
3
4
+ ## 2.1.1
5
+
6
+ * Changed argument of ` load ` event from url to event object
7
+ * Fixed ` prev() ` return value
8
+
4
9
## 2.1.0
5
10
6
11
* Added History extension
Original file line number Diff line number Diff line change 1
- Infinite Ajax Scroll 2
2
- ======================
1
+ Infinite Ajax Scroll
2
+ ====================
3
3
4
4
A jQuery plugin to turn your paginated pages into infinite scrolling pages with ease.
5
5
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " jquery-ias" ,
3
- "version" : " 2.1.0 " ,
3
+ "version" : " 2.1.1 " ,
4
4
"homepage" : " http://infiniteajaxscroll.com" ,
5
- "main" : " src/jquery. ias.js" ,
5
+ "main" : " src/jquery- ias.js" ,
6
6
"ignore" : [
7
7
" **/.*" ,
8
8
" node_modules" ,
Original file line number Diff line number Diff line change 2
2
"name" : " ias" ,
3
3
"title" : " Infinite Ajax Scroll" ,
4
4
"description" : " jQuery plugin that progressively enhances your server-side pagination" ,
5
- "version" : " 2.1.0 " ,
5
+ "version" : " 2.1.1 " ,
6
6
"homepage" : " http://infiniteajaxscroll.com" ,
7
7
"download" : " http://infiniteajaxscroll.com/download.html" ,
8
8
"docs" : " http://infiniteajaxscroll.com/docs/getting-started.html" ,
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " jquery-ias" ,
3
3
"title" : " Infinite Ajax Scroll" ,
4
- "version" : " 2.1.0 " ,
4
+ "version" : " 2.1.1 " ,
5
5
"description" : " A jQuery plugin that turns your server-side pagination into an infinite scrolling one using AJAX" ,
6
6
"homepage" : " http://infiniteajaxscroll.com" ,
7
7
"main" : " src/jquery-ias.js" ,
Original file line number Diff line number Diff line change 1
1
/**
2
- * Infinite Ajax Scroll v2.1.0
2
+ * Infinite Ajax Scroll v2.1.1
3
3
* A jQuery plugin for infinite scrolling
4
4
* http://infiniteajaxscroll.com
5
5
*
171
171
172
172
delay = delay || this . defaultDelay ;
173
173
174
- self . fire ( 'load' , [ url ] ) ;
174
+ var loadEvent = {
175
+ url : url
176
+ } ;
177
+
178
+ self . fire ( 'load' , [ loadEvent ] ) ;
175
179
176
- return $ . get ( url , null , $ . proxy ( function ( data ) {
180
+ return $ . get ( loadEvent . url , null , $ . proxy ( function ( data ) {
177
181
$itemContainer = $ ( this . itemsContainerSelector , data ) . eq ( 0 ) ;
178
182
if ( 0 === $itemContainer . length ) {
179
183
$itemContainer = $ ( data ) . filter ( this . itemsContainerSelector ) . eq ( 0 ) ;
Original file line number Diff line number Diff line change @@ -44,6 +44,38 @@ describe("IAS", function () {
44
44
return deferred . promise ;
45
45
} ) ;
46
46
47
+ it ( "should allow url to be changed in load event" , function ( ) {
48
+ var deferred = when . defer ( ) ;
49
+
50
+ jQuery . ias ( {
51
+ container : '.listing' ,
52
+ item : '.post' ,
53
+ pagination : '.navigation' ,
54
+ next : '.next-posts a'
55
+ } ) ;
56
+
57
+ // first listener changes the url
58
+ jQuery . ias ( ) . on ( 'load' , function ( loadEvent ) {
59
+ // assert that it isn't already there
60
+ buster . refute . contains ( loadEvent . url , "ajax=1" ) ;
61
+
62
+ loadEvent . url = loadEvent . url + "?ajax=1" ;
63
+ } ) ;
64
+
65
+ // second listener asserts the url is changed
66
+ jQuery . ias ( ) . on ( 'load' , function ( loadEvent ) {
67
+ buster . assert . contains ( loadEvent . url , "ajax=1" ) ;
68
+ } ) ;
69
+
70
+ scrollDown ( ) . then ( function ( ) {
71
+ wait ( 2000 ) . then ( function ( ) {
72
+ deferred . resolve ( ) ;
73
+ } ) ;
74
+ } ) ;
75
+
76
+ return deferred . promise ;
77
+ } ) ;
78
+
47
79
it ( "should call render listeners when render is complete" , function ( ) {
48
80
var deferred = when . defer ( ) ;
49
81
var spy1 = this . spy ( ) ;
Original file line number Diff line number Diff line change 1
- var config = module . exports ;
1
+ var config = module . exports ,
2
+ fs = require ( 'fs' ) ,
3
+ bower = {
4
+ jquery : {
5
+ main : 'jquery.js'
6
+ }
7
+ } ;
8
+
9
+ if ( fs . existsSync ( 'bower_components/jquery/bower.json' ) ) {
10
+ bower . jquery = JSON . parse ( fs . readFileSync ( 'bower_components/jquery/bower.json' , 'utf8' ) )
11
+ }
2
12
3
13
config [ "My tests" ] = {
4
14
rootPath : "../" ,
5
15
environment : "browser" , // or "node"
6
16
libs : [
7
- "bower_components/jquery/jquery.min.js"
17
+ "bower_components/jquery/" + bower . jquery . main . replace ( / ^ \. \/ / , '' ) ,
8
18
] ,
9
19
sources : [
10
20
"src/callbacks.js" ,
You can’t perform that action at this time.
0 commit comments