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

Course: Changing groupmode of an activity via AJAX does not change the button's class

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 2.8.9, 2.9.3
    • 2.8.8, 2.9.2
    • Course
    • MOODLE_28_STABLE, MOODLE_29_STABLE
    • MOODLE_28_STABLE, MOODLE_29_STABLE
    • MDL-51679-groupmode-ajax
    • Easy
    • Hide
      1. Go to Site Administration > Appearance > AJAX and Javascript.
      2. Uncheck the "Activity editing menus". Click "Save changes"
      3. Go to a course with at least one activity/resource which has group modes. (i.e. Forum, Assignment)
      4. Under Course administration, click "Turn editing on".
      5. Press F12 to open the browser's developer console.
      6. Click on the group mode of a resource with a group mode. Confirm that:
        The img tag's src attribute changes.
        The parent a tag's "editing_" class attribute changes based on the current group mode (editing_groupsnone, editing_groupsseparate, editing_groupsvisible).
      Show
      Go to Site Administration > Appearance > AJAX and Javascript. Uncheck the "Activity editing menus". Click "Save changes" Go to a course with at least one activity/resource which has group modes. (i.e. Forum, Assignment) Under Course administration, click "Turn editing on". Press F12 to open the browser's developer console. Click on the group mode of a resource with a group mode. Confirm that: The img tag's src attribute changes. The parent a tag's "editing_" class attribute changes based on the current group mode (editing_groupsnone, editing_groupsseparate, editing_groupsvisible).

      About the AJAX buttons that are displayed alongside every activity when courses are edited:

      When the user clicks a button, an AJAX request is fired to perform a change. At the same time, the expected result of that request is displayed to the user by changing the CSS class of the button and the image inside it. At least, this is what I expect – for the show/hide button, this is also exactly what happens: For a show button, the CSS class of the button switches from ediding_show to editing_hide, and the image is switched accordingly. File: course/yui/src/toolboxes/js/resource.js:414.

      For groupmode, this is partially broken: The image is switched (course/yui/src/toolboxes/js/resource.js:488), but the CSS class isn't. This is bad for themes that rely on that class: For instance, the theme essential replaces most images with an icon font. Updating the icon font would certainly be way too specific. Updating the class, however, would allow me to define according styles that change the icon based on the button's class.

      For reproduction:
      1. DISABLE the option to use "Activity editing menus" in Site Administration > Appearance > AJAX and Javascript. (SAVE SETTINGS)
      2. Open a course with at least one activity and turn on editing mode.
      3. In preparation for the following steps, open up a developer console (F12).
      4. Click on a hide or show button. Observe that the img tag's src attribute changes; observe that its parent a tag's class attribute changes.
      5. Click on a groupmode button. Observe that the img tag's src attribute changes; but that the parent a tag's class attribute remains unchanged.

            jan.dagefoerde Jan Dageförde
            jan.dagefoerde Jan Dageförde
            Jun Pataleta Jun Pataleta
            Dan Poltawski Dan Poltawski
            cameron1729 cameron1729
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.