mirror of
https://github.com/moodle/moodle.git
synced 2025-08-09 10:56:56 +02:00
MDL-76974 javascript: convert remaining uses of old preferences API.
Implement component preference definition callbacks, update JS code to use the `core_user/repository` module instead of the now deprecated API.
This commit is contained in:
parent
d096c60e0c
commit
b30245b3e2
21 changed files with 180 additions and 38 deletions
|
@ -679,7 +679,6 @@ abstract class user_selector_base {
|
|||
'" value="1"' . $checked . ' /> ' . $label .
|
||||
"</label>
|
||||
</div>\n";
|
||||
user_preference_allow_ajax_update($name, PARAM_BOOL);
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
|
|
@ -368,7 +368,9 @@ M.core_user.init_user_selector_options_tracker = function(Y) {
|
|||
* @param {string} name The name of the preference to set
|
||||
*/
|
||||
set_user_preference : function(e, name) {
|
||||
M.util.set_user_preference(name, Y.one('#' + name + 'id').get('checked'));
|
||||
require(['core_user/repository'], function(UserRepository) {
|
||||
UserRepository.setUserPreference(name, Y.one('#' + name + 'id').get('checked'));
|
||||
});
|
||||
}
|
||||
};
|
||||
// Initialise the options tracker
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue