Browse Source

Fixes #1245: LinkPager now renders disabled links as spans preventing these to be clickable

tags/2.0.0-beta
Alexander Makarov 11 years ago
parent
commit
c5e8aabe05
  1. 8
      framework/yii/widgets/LinkPager.php

8
framework/yii/widgets/LinkPager.php

@ -164,14 +164,14 @@ class LinkPager extends Widget
*/
protected function renderPageButton($label, $page, $class, $disabled, $active)
{
$options = ['class' => $class === '' ? null : $class];
if ($active) {
$class .= ' ' . $this->activePageCssClass;
Html::addCssClass($options, $this->activePageCssClass);
}
if ($disabled) {
$class .= ' ' . $this->disabledPageCssClass;
Html::addCssClass($options, $this->disabledPageCssClass);
return Html::tag('li', Html::tag('span', $label), $options);
}
$class = trim($class);
$options = ['class' => $class === '' ? null : $class];
return Html::tag('li', Html::a($label, $this->pagination->createUrl($page), ['data-page' => $page]), $options);
}

Loading…
Cancel
Save