From d8eb591549734fbdb1c97e2cee68db0e61f0cb19 Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Tue, 29 Apr 2008 03:25:19 +0000 Subject: [PATCH] Made function not throw in IE when run before the page is fully loaded. --- static/js/Wiki.js | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/static/js/Wiki.js b/static/js/Wiki.js index db8ca7e..806ffa6 100644 --- a/static/js/Wiki.js +++ b/static/js/Wiki.js @@ -2941,15 +2941,21 @@ Recent_notes.prototype.total_notes_count_updated = function( count ) { } Recent_notes.prototype.update_navigation_links = function() { - if ( this.total_notes_count > this.max_recent_notes_count ) - removeElementClass( "recent_notes_more_link", "undisplayed" ); - else - addElementClass( "recent_notes_more_link", "undisplayed" ); + var more_link = getElement( "recent_notes_more_link" ); + if ( more_link ) { + if ( this.total_notes_count > this.max_recent_notes_count ) + removeElementClass( more_link, "undisplayed" ); + else + addElementClass( more_link, "undisplayed" ); + } - if ( this.max_recent_notes_count > this.INCREMENT ) - removeElementClass( "recent_notes_less_link", "undisplayed" ); - else - addElementClass( "recent_notes_less_link", "undisplayed" ); + var less_link = getElement( "recent_notes_less_link" ); + if ( less_link ) { + if ( this.max_recent_notes_count > this.INCREMENT ) + removeElementClass( less_link, "undisplayed" ); + else + addElementClass( less_link, "undisplayed" ); + } } Recent_notes.prototype.link_clicked = function ( event ) {