Línea 19... |
Línea 19... |
19 |
* @module gradereport_grader/stickycolspan
|
19 |
* @module gradereport_grader/stickycolspan
|
20 |
* @copyright 2022 Bas Brands <bas@moodle.com>
|
20 |
* @copyright 2022 Bas Brands <bas@moodle.com>
|
21 |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
21 |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
22 |
*/
|
22 |
*/
|
Línea 23... |
Línea -... |
23 |
|
- |
|
24 |
import $ from 'jquery';
|
23 |
|
Línea 25... |
Línea 24... |
25 |
import {SELECTORS as stickyFooterSelectors, eventTypes as stickyFooterEvents} from 'core/sticky-footer';
|
24 |
import {SELECTORS as stickyFooterSelectors, eventTypes as stickyFooterEvents} from 'core/sticky-footer';
|
26 |
|
25 |
|
27 |
const SELECTORS = {
|
26 |
const SELECTORS = {
|
Línea 38... |
Línea 37... |
38 |
*/
|
37 |
*/
|
39 |
export const init = () => {
|
38 |
export const init = () => {
|
40 |
// The sticky positioning attributed to the user column cells affects the stacking context and makes the dropdowns
|
39 |
// The sticky positioning attributed to the user column cells affects the stacking context and makes the dropdowns
|
41 |
// within these cells to be cut off. To solve this problem, whenever one of these action menus (dropdowns) is opened
|
40 |
// within these cells to be cut off. To solve this problem, whenever one of these action menus (dropdowns) is opened
|
42 |
// we need to manually bump up the z-index value of the parent container element and revert once closed.
|
41 |
// we need to manually bump up the z-index value of the parent container element and revert once closed.
|
- |
|
42 |
document.querySelectorAll(SELECTORS.USERDROPDOWN).forEach((dropdown) => {
|
43 |
$(SELECTORS.USERDROPDOWN).on('show.bs.dropdown hide.bs.dropdown', (e) => {
|
43 |
dropdown.addEventListener('show.bs.dropdown', (e) => {
|
44 |
// The closest heading element has sticky positioning which affects the stacking context in this case.
|
44 |
// The closest heading element has sticky positioning which affects the stacking context in this case.
|
- |
|
45 |
e.target.closest(SELECTORS.TABLEHEADER).classList.add('actions-menu-active');
|
- |
|
46 |
});
|
- |
|
47 |
dropdown.addEventListener('hide.bs.dropdown', (e) => {
|
45 |
e.target.closest(SELECTORS.TABLEHEADER).classList.toggle('actions-menu-active');
|
48 |
e.target.closest(SELECTORS.TABLEHEADER).classList.remove('actions-menu-active');
|
- |
|
49 |
});
|
46 |
});
|
50 |
});
|
Línea 47... |
Línea 51... |
47 |
|
51 |
|
48 |
defineLastRowIntersectionObserver(true);
|
52 |
defineLastRowIntersectionObserver(true);
|
49 |
// Add an event listener to the sticky footer toggled event to re-define the average row intersection observer
|
53 |
// Add an event listener to the sticky footer toggled event to re-define the average row intersection observer
|