mirror of
https://github.com/moodle/moodle.git
synced 2025-07-24 15:51:56 +02:00
MDL-20204 new single_select + cleanup
This commit is contained in:
@@ -381,6 +381,19 @@ M.util.init_maximised_embed = function(Y, id) {
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* Attach handler to single_select
|
||||
*/
|
||||
M.util.init_single_select = function(Y, formid, selectid, nothing) {
|
||||
YUI(M.yui.loader).use('node', function(Y) {
|
||||
Y.on('change', function() {
|
||||
if ((nothing == false && Y.Lang.isBoolean(nothing)) || Y.one('#'+selectid).get('value') != nothing) {
|
||||
Y.one('#'+formid).submit();
|
||||
}
|
||||
},
|
||||
'#'+selectid);
|
||||
});
|
||||
};
|
||||
|
||||
//=== old legacy JS code, hopefully to be replaced soon by M.xx.yy and YUI3 code ===
|
||||
|
||||
|
Reference in New Issue
Block a user