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

Improve the close_window function in weblib.php

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: 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

      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

            Assignee:
            timhunt Tim Hunt
            Reporter:
            timhunt Tim Hunt
            Tester:
            Dongsheng Cai
            Participants:
            Component watchers:
            Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              21/Feb/11