MDL-35569 AJAX Move auto-submitting selects to separate YUI module

This commit is contained in:
Andrew Robert Nicols
2012-09-21 15:17:22 +01:00
parent ecfe814e0f
commit 7266bd3e59
10 changed files with 173 additions and 15 deletions

View File

@@ -376,8 +376,15 @@ M.util.init_maximised_embed = function(Y, id) {
/**
* Attach handler to single_select
*
* This code was deprecated in Moodle 2.4 and will be removed in Moodle 2.6
*
* Please see lib/yui/formautosubmit/formautosubmit.js for its replacement
*/
M.util.init_select_autosubmit = function(Y, formid, selectid, nothing) {
if (M.cfg.developerdebug) {
Y.log("You are using a deprecated function call (M.util.init_select_autosubmit). Please look at rewriting your call to use moodle-core-formautosubmit");
}
Y.use('event-key', function() {
var select = Y.one('#'+selectid);
if (select) {
@@ -451,6 +458,9 @@ M.util.init_select_autosubmit = function(Y, formid, selectid, nothing) {
* This function has accessability issues and also does not use the formid passed through as a parameter.
*/
M.util.init_url_select = function(Y, formid, selectid, nothing) {
if (M.cfg.developerdebug) {
Y.log("You are using a deprecated function call (M.util.init_url_select). Please look at rewriting your call to use moodle-core-formautosubmit");
}
YUI().use('node', function(Y) {
Y.on('change', function() {
if ((nothing == false && Y.Lang.isBoolean(nothing)) || Y.one('#'+selectid).get('value') != nothing) {