Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-825

javascript focus is annoying / disruptive

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: 1.1.1
    • Fix Version/s: None
    • Component/s: General
    • Labels:
      None
    • Environment:
      All
    • Affected Branches:
      MOODLE_11_STABLE

      Description

      There is a setfocus javascript function that sets the focus to certain things when a page is loaded. Quite often this is annoying because many browsers remember where on the page you were when you hit the back button. Say I have scrolled 3/4 the way down a long page... and I click a link to look at a resource/assignment/etc. Then when I click the back button on my browser, I expect to go back to the previous page 3/4 of the way down. This is standard on most modern browsers. Because of the javascript focus command, however I go back all the way to the top of the page.

      There may be multiple places where this occurs and is annoying, but one place that particularly bugs me is from the /course/view.php page. The setfocus goes to nearly the top of the page to the search forums form. I feel that the primary use of the view.php page is not to search the forums, so the handy setfocus does more harm than it does good.

      Fix:

      remove search.search

      from this line:

      print_header($courseword: $course->fullname, $course->fullname, $course->shortname, search.search, , true,

      update_course_icon($course->id), $loggedinas);

      in view.php.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: