Catch undefined height parameter, cancel pager link.
authorJan Schneider <jan@horde.org>
Fri, 2 Jul 2010 10:47:06 +0000 (12:47 +0200)
committerJan Schneider <jan@horde.org>
Fri, 2 Jul 2010 10:49:43 +0000 (12:49 +0200)
horde/lib/Block/twitter_timeline.php

index 7a0a705..c7e28f8 100644 (file)
@@ -164,10 +164,10 @@ EOT;
            . '<div><a class="button" onclick="Horde.twitter.updateStatus($F(\'' . $instance . '_newStatus\'));" href="#">' . _("Update") . '</a><span id="' . $instance . '_inReplyTo"></span></div>'
            . Horde::img('loading.gif', '', array('id' => $instance . '_loading', 'style' => 'display:none;'));
         $html .= '<div id="currentStatus" class="fbemptystatus" style="margin-left:10px;margin-top:10px;">' . sprintf(_("Latest: %s - %s"), $latestStatus, Horde_Date_Utils::relativeDateTime(strtotime($this->_profile->status->created_at), $GLOBALS['prefs']->getValue('date_format'), ($GLOBALS['prefs']->getValue('twentyFour') ? "%H:%M %P" : "%I %M %P"))) . '</div>';
-        $html .= '<div style="height:' . $this->_params['height'] . 'px;overflow-y:auto;" id="twitter_body' . $instance . '">';
+        $html .= '<div style="height:' . (empty($this->_params['height']) ? 250 : $this->_params['height']) . 'px;overflow-y:auto;" id="twitter_body' . $instance . '">';
         $filter = Horde_Text_Filter::factory('Text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO));
         $html .= '</div>';
-        $html .= '<div class="control fbgetmore"><a href="#" onclick="Horde.twitter.updateStream(++Horde.twitter.page);">' . _("Get More") . '</a></div>';
+        $html .= '<div class="control fbgetmore"><a href="#" onclick="Horde.twitter.updateStream(++Horde.twitter.page);return false;">' . _("Get More") . '</a></div>';
         $html .= '</div>';
 
         return $html;