https://www.mediawiki.org/wiki/Special:Code/MediaWiki/112520
Revision: 112520
Author: catrope
Date: 2012-02-27 21:33:11 +0000 (Mon, 27 Feb 2012)
Log Message:
-----------
Fix bug in proofread.js that was causing a JS error if textarea#wpTextbox1 and
div#copywarn are not adjacent siblings. Instead of assuming that copywarn is
the next sibling of wpTextbox1, use .nextSibling to insert the table in the
right place.
Modified Paths:
--------------
trunk/extensions/ProofreadPage/proofread.js
Modified: trunk/extensions/ProofreadPage/proofread.js
===================================================================
--- trunk/extensions/ProofreadPage/proofread.js 2012-02-27 21:29:19 UTC (rev
112519)
+++ trunk/extensions/ProofreadPage/proofread.js 2012-02-27 21:33:11 UTC (rev
112520)
@@ -749,18 +749,18 @@
return;
}
var f = text.parentNode;
- var new_text = f.removeChild( text );
if( proofreadPageIsEdit ) {
pr_make_edit_area( self.text_container, new_text.value );
- var copywarn = document.getElementById( 'editpage-copywarn' );
- f.insertBefore( table, copywarn );
+ f.insertBefore( table, text.nextSibling ); // Inserts table
after text
+ f.removeChild( text );
if ( !self.proofreadpage_show_headers ) {
hookEvent( 'load', pr_toggle_visibility );
} else {
hookEvent( 'load', pr_reset_size );
}
} else {
+ var new_text = f.removeChild( text );
self.text_container.appendChild( new_text );
f.appendChild( self.table );
}
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs