From: Trevor Parscal Date: Fri, 7 Aug 2009 20:24:10 +0000 (+0000) Subject: Opera 8 can't get a ref to a form element, so it was just spitting out errors. This... X-Git-Tag: 1.31.0-rc.0~40432 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=57486ee7fd824fe51033b8b916a087e4ce861b68;p=lhc%2Fweb%2Fwiklou.git Opera 8 can't get a ref to a form element, so it was just spitting out errors. This checks the form element is valid before trying to use it. --- diff --git a/skins/common/edit.js b/skins/common/edit.js index 94c24a259b..2941b86b58 100644 --- a/skins/common/edit.js +++ b/skins/common/edit.js @@ -146,10 +146,11 @@ function scrollEditBox() { var editBox = document.getElementById( 'wpTextbox1' ); var scrollTop = document.getElementById( 'wpScrolltop' ); var editForm = document.getElementById( 'editform' ); - if( editBox && scrollTop ) { + if( editForm && editBox && scrollTop ) { if( scrollTop.value ) editBox.scrollTop = scrollTop.value; addHandler( editForm, 'submit', function() { + alert(1); document.getElementById( 'wpScrolltop' ).value = document.getElementById( 'wpTextbox1' ).scrollTop; } ); }