can3p (can3p) wrote in changelog,
can3p
can3p
changelog

[livejournal] r17583: LJSUP-7211: Loaded only one picture, but...

Committer: dpetrov
LJSUP-7211: Loaded only one picture, but the arrows are active
U   trunk/htdocs/js/widgets/photos2homepage.js
Modified: trunk/htdocs/js/widgets/photos2homepage.js
===================================================================
--- trunk/htdocs/js/widgets/photos2homepage.js	2010-10-20 09:31:04 UTC (rev 17582)
+++ trunk/htdocs/js/widgets/photos2homepage.js	2010-10-21 06:40:25 UTC (rev 17583)
@@ -25,6 +25,8 @@
 			this.imageHash[ i ] = new Image();
 			this.imageHash[ i ].src = photos2homepage[ i ].src;
 		}
+
+		this._updatePageButtons();
 	},
 
 	prev: function(){
@@ -40,8 +42,7 @@
 	},
 
 	_updatePager: function(){
-		this.controls.prev[(this.page == 1)?"addClass":"removeClass"]('i-potd-nav-prev-dis');
-		this.controls.next[(this.page == this.pages)?"addClass":"removeClass"]('i-potd-nav-next-dis');
+		this._updatePageButtons();
 
 		var idx = 0;
 		for( var i = 0; i < this.ppCount; ++i ){
@@ -57,5 +58,10 @@
 			else
 				this.images[ i ].li.style.display = 'none';
 		}
+	},
+
+	_updatePageButtons: function(){
+		this.controls.prev[(this.page == 1)?"addClass":"removeClass"]('i-potd-nav-prev-dis');
+		this.controls.next[(this.page == this.pages || !this.pages)?"addClass":"removeClass"]('i-potd-nav-next-dis');
 	}
 }

Tags: can3p, 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