--- no_pager/no_pager.js 2006/08/16 21:36:40 16
+++ no_pager/no_pager.js 2006/08/16 23:37:51 18
@@ -8,6 +8,7 @@
var preloadDistance = 1000;
var isUpdating = false;
+var isMouseDown = false;
var checker;
var v;
var cookie = 'no_pager';
@@ -34,6 +35,7 @@
setCookie(cookie+"_scroll", getScrollHeight() - _getWindowHeight() );
if ( isUpdating == true
+ || isMouseDown == true
|| getPageHeight() - getScrollHeight() > preloadDistance
|| v.page >= v.max_page
) return;
@@ -60,22 +62,7 @@
},
function ( response ) {
- if (response.length < 500) {
- $('#footer').show();
- if ( v.page > 0 ) {
- $('#more_history').html('
No more results.
');
- } else {
- $('#more_history').html('No results matched your search.
');
- }
- $('#status').html( 'All results shown.' );
- return;
- }
-
- response += "";
- response += " More posts are being loaded...
";
- response += " If you are using the scroll bar, release the mouse to see more posts.";
- response += "
"
- $('#more_history').html( response );
+ $('#next_page').html( response );
eval( 'v=' + $('#json').val() );
@@ -117,6 +104,12 @@
scroll( 0, getCookie(cookie+'_scroll') );
}
+ $(window).mousedown( function () {
+ isMouseDown = true;
+ });
+ $(window).mouseup( function () {
+ isMouseDown = false;
+ });
checker = setInterval(function () {
load_page();