Fix breakage of Live preview (patch by dantman himself)
authorSiebrand Mazeland <siebrand@users.mediawiki.org>
Fri, 29 Aug 2008 13:46:06 +0000 (13:46 +0000)
committerSiebrand Mazeland <siebrand@users.mediawiki.org>
Fri, 29 Aug 2008 13:46:06 +0000 (13:46 +0000)
includes/EditPage.php
skins/common/shared.css

index c71942e..de41441 100644 (file)
@@ -1515,14 +1515,21 @@ END
 
        protected function displayPreviewArea( $previewOutput, $isOnTop = false ) {
                global $wgOut;
-               $classes = array( 'wikiPreview' );
-               if( $isOnTop ) $classes[] = 'ontop';
-               $attribs = array( 'class' => implode( ' ', $classes ) );
-               if( $this->formtype != 'preview' ) $attribs['style'] = 'display: none;';
+               $classes = array();
+               if( $isOnTop )
+                       $classes[] = 'ontop';
+
+               $attribs = array( 'id' => 'wikiPreview', 'class' => implode( ' ', $classes ) );
+
+               if( $this->formtype != 'preview' )
+                       $attribs['style'] = 'display: none;';
+
                $wgOut->addHTML( Xml::openElement( 'div', $attribs ) );
+
                if ( $this->formtype == 'preview' ) {
                        $this->showPreview( $previewOutput );
                }
+
                $wgOut->addHTML( '</div>' );
 
                if ( $this->formtype == 'diff') {
index 9da9821..daba44b 100644 (file)
@@ -11,7 +11,7 @@ span.texhtml { font-family: serif; }
 
 /* add a bit of margin space between the preview and the toolbar */
 /* this replaces the ugly <p><br /></p> we used to insert into the page source */
-.wikiPreview.ontop { margin-bottom: 1em; }
+#wikiPreview.ontop { margin-bottom: 1em; }
 
 /* Stop floats from intruding into edit area in previews */
 #toolbar, #wpTextbox1 { clear: both; }