-
Improvement
-
Resolution: Fixed
-
Minor
-
None
-
1.9.7
-
None
-
MS Windows
-
MOODLE_19_STABLE
When users click one of the column headers to sort the discussion list, this
loads a new page, and focus returns to top of page. They would like if focus on
the new page goes to the column header that was clicked.
It is possible to do this using # links but then the screen will scroll which
probably won't look great, so I suggest we use JavaScript.
Suggested implementation:
1. Change the sort links (only) to include an additional parameter
&sortlink=something (where each sort link has a different value for something).
Also add a unique id such as id="sortlink_something" to each link.
2. In the ForumNG javascript, write a new function forumng_focus_sort_links()
and make it run on page init.
3. In that function, check the current URL to see if it contains
&sortlink=(something) and get the value of something if so. You can do this
with a regular expression that will still work even if there is another &
parameter added later.
4. If 'something' is set, get all the <a> tags with
document.getElementsById and set focus on that
link.