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

Improve the close_window function in weblib.php

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.0.1
    • 2.0.2
    • Libraries
    • MOODLE_20_STABLE
    • MOODLE_20_STABLE

    Description

      There are two problems:

      1. In the case where the second argument, $reloadopener, is false, then the code currently does not work. It was calling the close_window javascrip function with no arguments, but that does not work, because it requires an e argument that is an object.

      2. In the case when $reloadopener is true, then it was not starting to reload the opener window until after the delay. It is much better for users if we start reloading the parent window immediately, and only delay closing the popup.

      I implemented this by deleting the old close_window_reloading_opener JavaScript function. That is not used anywhere else in core or in contrib, according to my search.

      The new code works in IE and FF. I am sure it will work in any place where the old code worked.

      Attachments

        Activity

          People

            timhunt Tim Hunt
            timhunt Tim Hunt
            Dongsheng Cai Dongsheng Cai
            David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              21/Feb/11