Moodle
  1. Moodle
  2. MDL-26337

Improve the close_window function in weblib.php

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0.1
    • Fix Version/s: 2.0.2
    • Component/s: Libraries
    • Labels:
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE
    • Rank:
      16455

      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.

        Activity

        Hide
        Dongsheng Cai added a comment -

        tested, thanks!

        Show
        Dongsheng Cai added a comment - tested, thanks!

          People

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

            Dates

            • Created:
              Updated:
              Resolved: