From 57486ee7fd824fe51033b8b916a087e4ce861b68 Mon Sep 17 00:00:00 2001 From: Trevor Parscal Date: Fri, 7 Aug 2009 20:24:10 +0000 Subject: [PATCH] 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. --- skins/common/edit.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; } ); } -- 2.20.1