Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 17... Línea 17...
17
 * A small dropdown to filter users within the gradebook.
17
 * A small dropdown to filter users within the gradebook.
18
 *
18
 *
19
 * @module    core_grades/searchwidget/initials
19
 * @module    core_grades/searchwidget/initials
20
 * @copyright 2022 Mathew May <mathew.solutions>
20
 * @copyright 2022 Mathew May <mathew.solutions>
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
 * @deprecated since Moodle 4.5 - please use core_course/actionbar/initials instead.
-
 
23
 * @todo       Final deprecation in Moodle 6.0. See MDL-82421.
22
 */
24
 */
Línea 23... Línea 25...
23
 
25
 
24
import Pending from 'core/pending';
26
import Pending from 'core/pending';
25
import * as Url from 'core/url';
27
import * as Url from 'core/url';
26
import CustomEvents from "core/custom_interaction_events";
28
import CustomEvents from "core/custom_interaction_events";
Línea 27... Línea 29...
27
import $ from 'jquery';
29
import Dropdown from 'theme_boost/bootstrap/dropdown';
28
 
30
 
29
/**
31
/**
30
 * Whether the event listener has already been registered for this module.
32
 * Whether the event listener has already been registered for this module.
Línea 63... Línea 65...
63
        return;
65
        return;
64
    }
66
    }
65
    const pendingPromise = new Pending();
67
    const pendingPromise = new Pending();
66
    registerListenerEvents(callingLink, gpr_userid, gpr_search);
68
    registerListenerEvents(callingLink, gpr_userid, gpr_search);
67
    // BS events always bubble so, we need to listen for the event higher up the chain.
69
    // BS events always bubble so, we need to listen for the event higher up the chain.
68
    $(selectors.parentDomNode).on('shown.bs.dropdown', () => {
70
    document.querySelector(selectors.parentDomNode).addEventListener('shown.bs.dropdown', () => {
69
        document.querySelector(selectors.pageClickableItem).focus({preventScroll: true});
71
        document.querySelector(selectors.pageClickableItem).focus({preventScroll: true});
70
    });
72
    });
71
    pendingPromise.resolve();
73
    pendingPromise.resolve();
72
    registered = true;
74
    registered = true;
73
};
75
};
Línea 135... Línea 137...
135
                        params.gpr_userid = gpr_userid;
137
                        params.gpr_userid = gpr_userid;
136
                    }
138
                    }
137
                    window.location = Url.relativeUrl(callingLink, params);
139
                    window.location = Url.relativeUrl(callingLink, params);
138
                }
140
                }
139
                if (e.target.dataset.action === selectors.formItems.cancel) {
141
                if (e.target.dataset.action === selectors.formItems.cancel) {
140
                    $(`.${selectors.targetButton}`).dropdown('toggle');
142
                    Dropdown.getOrCreateInstance(document.querySelector(`.${selectors.targetButton}`)).toggle();
141
                }
143
                }
142
            }
144
            }
143
        });
145
        });
144
    });
146
    });
145
};
147
};