can3p (can3p) wrote in changelog,
can3p
can3p
changelog

[livejournal] r21100: LJSUP-11138: Incorrect working links Nex...

Committer: dpetrov
LJSUP-11138: Incorrect working links Next and Previous
U   trunk/htdocs/js/jquery/jquery.lj.lazyLoadable.js
Modified: trunk/htdocs/js/jquery/jquery.lj.lazyLoadable.js
===================================================================
--- trunk/htdocs/js/jquery/jquery.lj.lazyLoadable.js	2012-02-06 08:26:07 UTC (rev 21099)
+++ trunk/htdocs/js/jquery/jquery.lj.lazyLoadable.js	2012-02-06 09:13:24 UTC (rev 21100)
@@ -117,12 +117,11 @@
 				this._containerBottom = this._container.offset().top + this._container.height();
 			}
 
-			if (ans.status === 'error' || ans.rows.length < this.options.pageSize) {
+			if (ans.status === 'error' || 
+					ans.rows.length < this.options.pageSize ||
+					this._count >= this.options.rowsLimit) {
 				this._disableLoader();
 				$window.unbind('scroll' + this._eventNamespace);
-			} else if (this._count >= this.options.rowsLimit) {
-				this._disableLoader();
-				$window.unbind('scroll' + this._eventNamespace);
 				this._showPagination(this._count === this.options.rowsLimit);
 			}
 
@@ -134,6 +133,8 @@
 		},
 
 		_showPagination: function(showBothButtons) {
+			//we should now show pagination on the first page if we know, that there is no next page
+			if (this._count < this.options.rowsLimit && this.options.startOffset === 0) { return; }
 			this._updatePagination();
 
 			if (this.options.startOffset > 0 && !showBothButtons) {

Tags: can3p, dpetrov, js, livejournal
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments