Skip to content

Commit 372a4d2

Browse files
committed
Merge pull request gbirke#7 from alexhayes/master
Closes gbirke#4: Callback is called when pagination is created
2 parents 19ac803 + f51dbf1 commit 372a4d2

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

README.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ ellipse_text
112112
displayed number interval, this text will be inserted into the gap (inside a
113113
span tag). Can be left blank to avoid the additional tag. Default: ``...``
114114

115+
load_first_page
116+
If true (default) then the first page will be loaded automatically.
115117

116118
Triggering pagination with custom events
117119
----------------------------------------

src/jquery.pagination.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@
142142
prev_show_always:true,
143143
next_show_always:true,
144144
renderer:"defaultRenderer",
145+
load_first_page:false,
145146
callback:function(){return false;}
146147
},opts||{});
147148

@@ -222,7 +223,9 @@
222223
containers.empty();
223224
links.appendTo(containers);
224225
// call callback function
225-
opts.callback(current_page, containers);
226+
if(opts.load_first_page) {
227+
opts.callback(current_page, containers);
228+
}
226229
} // End of $.fn.pagination block
227230

228231
})(jQuery);

0 commit comments

Comments
 (0)