vanillaforums/Garden — Issue #1314: Entire page refreshes when clicking 'Previous Results' using MorePager
Author: Csabbencs
Created: 2012-03-06 15:05:44+00:00
State: open

On a page of results, first, you have only 'More Results' link.
When you click on it, the view refreshes and a new set of results is appended (entire page not reloaded), you have both 'More Results' and 'Previous Results' link.
Then, when clicking 'Previous Results' link, the entire page is reloaded instead of refreshing only the view.

The cause of it is that the element containing the "less" link is not binded to the page by javasrcipt on the first page, thus, it will not be binded on more pages either.

A possible solution is returning both 'more' and 'less' links always, setting their container 'hidden' when it is necessary.
Therefore, I recommend the following changes in dashboard/modules/class.morepagermodule.php:
1. Add this to the constructor method:
```$this->CssHiddenClass = 'MorePager Hidden';```
2. Change returning value of function ToString:
``` if ($Pager == '')
// return $this->PagerEmpty; //old line
return sprintf($this->Wrapper, Attribute(array('id' => $ClientID, 'class' => $this->CssHiddenClass)), $Pager); //new line```

Please fix.