Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: None
    • Component/s: General
    • Labels:
      None
    • Affected Branches:
      MOODLE_20_STABLE
    • Rank:
      795

      Description

      List of tasks related to new recommended JS usage, JS API improvements and conversion to YUI3

        Activity

        Hide
        Sam Hemelryk added a comment -

        Hi Petr,

        I found that the collapsible region code wasn't working for me today, there was a problem with the way in which it was getting+setting heights when toggling the animation on the click event. After looking at the code I decided that I wasn't a big fan of code behind the collapsible region and came up with the attached patch.

        Changes are as follows:

        • Class is written in the set and forget method it seemed to be used in, no methods after construct.
        • Upgraded the code to YUI 3, now makes full use of YUI nodes and the cool stuff they can do.
        • Off loaded CSS class toggling into the animation module instance events.
        • Fixed up the way the animation toggled (there is a reverse property... much better than changing to and from each click).
        • Fixes the issue with animation and heights whereby elements would override due to crazy heights madness as above.
        • Tidied up the jsdocs.

        What this doesn't do that could be done.

        • This doesn't change the underlying HTML in weblib's print collapsible region function however I am 99% sure half of the HTML it generates is not needed. Not really a problem so I didn't change anything there.
        • Clean up the CSS for the structure, only one of the CSS rules is actually relevant, the rest could disappear and not be missed. This could be cleaned up when we migrate the CSS into the base theme.

        See what you think of this patch.

        Cheers
        Sam

        Show
        Sam Hemelryk added a comment - Hi Petr, I found that the collapsible region code wasn't working for me today, there was a problem with the way in which it was getting+setting heights when toggling the animation on the click event. After looking at the code I decided that I wasn't a big fan of code behind the collapsible region and came up with the attached patch. Changes are as follows: Class is written in the set and forget method it seemed to be used in, no methods after construct. Upgraded the code to YUI 3, now makes full use of YUI nodes and the cool stuff they can do. Off loaded CSS class toggling into the animation module instance events. Fixed up the way the animation toggled (there is a reverse property... much better than changing to and from each click). Fixes the issue with animation and heights whereby elements would override due to crazy heights madness as above. Tidied up the jsdocs. What this doesn't do that could be done. This doesn't change the underlying HTML in weblib's print collapsible region function however I am 99% sure half of the HTML it generates is not needed. Not really a problem so I didn't change anything there. Clean up the CSS for the structure, only one of the CSS rules is actually relevant, the rest could disappear and not be missed. This could be cleaned up when we migrate the CSS into the base theme. See what you think of this patch. Cheers Sam
        Hide
        Petr Škoda added a comment -

        hi, yes, it was far from perfect, +1 for commit

        Show
        Petr Škoda added a comment - hi, yes, it was far from perfect, +1 for commit
        Hide
        Petr Škoda added a comment -

        yay, we can close this now!

        Show
        Petr Škoda added a comment - yay, we can close this now!

          People

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

            Dates

            • Created:
              Updated:
              Resolved: