Advertisement
AndreyKlipikov

CPager Fix (Yii) [Govnokod]

Dec 8th, 2013
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 1.09 KB | None | 0 0
  1. if ($('.pager').size() > 0) {
  2.     $('.yiiPager li:visible').each(function() {
  3.         if ($('a', this).text().indexOf('Предыдущая') > -1 && !$('.previous').hasClass('hidden'))
  4.             $('a', this).attr('href', '/admin/' + location.href.split('/')[4] + '/?page=' + (Number($('.yiiPager li.selected a').text()) - 1))
  5.         else if ($('a', this).text().indexOf('Предыдущая') > -1 && $('.previous').hasClass('hidden'))
  6.             $('a', this).attr('href', '/admin/' + location.href.split('/')[4] + '/?page=' + $('.yiiPager li.selected a').text())
  7.         else if ($('a', this).text().indexOf('Следующая') > -1 && !$('.next').hasClass('hidden'))
  8.             $('a', this).attr('href', '/admin/' + location.href.split('/')[4] + '/?page=' + (Number($('.yiiPager li.selected a').text()) + 1))
  9.         else if ($('a', this).text().indexOf('Следующая') > -1 && $('.next').hasClass('hidden'))
  10.             $('a', this).attr('href', '/admin/' + location.href.split('/')[4] + '/?page=' + $('.yiiPager li.selected a').text())
  11.         else
  12.             $('a', this).attr('href', '/admin/' + location.href.split('/')[4] + '/?page=' + $('a', this).text())
  13.     })
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement