Skip to content

Instantly share code, notes, and snippets.

@jdlrobson
Created April 7, 2012 10:26
Show Gist options
  • Save jdlrobson/2327272 to your computer and use it in GitHub Desktop.
Save jdlrobson/2327272 to your computer and use it in GitHub Desktop.
diff --git a/MobileFormatter.php b/MobileFormatter.php
index 69f4fcc..34e8260 100644
--- a/MobileFormatter.php
+++ b/MobileFormatter.php
@@ -193,7 +193,7 @@ class MobileFormatter extends HtmlFormatter {
$backToTop = $this->msg( 'mobile-frontend-back-to-top-of-section' );
$this->headings++;
// Back to top link
- $base = Html::openElement( 'div',
+ $backToTop = Html::openElement( 'div',
array( 'id' => 'anchor_' . intval( $this->headings - 1 ),
'class' => 'section_anchors',
)
@@ -217,7 +217,7 @@ class MobileFormatter extends HtmlFormatter {
array( 'class' => 'section_heading hide', 'section_id' => $this->headings ),
$hide
);
- $base .= Html::openElement( 'div', array( 'class' => 'section' ) );
+ $base = Html::openElement( 'div', array( 'class' => 'section' ) );
if ( $this->expandableSections ) {
$h2OnClick = 'javascript:wm_toggle_section(' . $this->headings . ');';
$base .= Html::openElement( 'h2',
@@ -243,6 +243,7 @@ class MobileFormatter extends HtmlFormatter {
if ( $this->headings > 1 ) {
// Close it up here
$base = '</div>' // <div class="content_block">
+ . $backToTop
. "</div>" // <div class="section">
. $base;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment