-
Bug
-
Resolution: Fixed
-
Minor
-
2.8.8, 2.9.2
-
MOODLE_28_STABLE, MOODLE_29_STABLE
-
MOODLE_28_STABLE, MOODLE_29_STABLE
-
MDL-51679-groupmode-ajax -
Easy
-
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.