MDL-34741 use proper default YUI_config

This commit is contained in:
Petr Škoda
2012-08-06 10:21:37 +02:00
parent 1c76d55a40
commit 2f422271c2
2 changed files with 21 additions and 20 deletions

View File

@@ -2,12 +2,12 @@
// Global M object is initilised in inline javascript
/**
* Add module to list of available modules that can be laoded from YUI.
* Add module to list of available modules that can be loaded from YUI.
* @param {Array} modules
*/
M.yui.add_module = function(modules) {
for (var modname in modules) {
M.yui.loader.modules[modname] = modules[modname];
YUI_config.modules[modname] = modules[modname];
}
};
/**
@@ -182,7 +182,7 @@ M.util.CollapsibleRegion.prototype.icon = null;
* @param String the value to set it to.
*/
M.util.set_user_preference = function(name, value) {
YUI(M.yui.loader).use('io', function(Y) {
YUI().use('io', function(Y) {
var url = M.cfg.wwwroot + '/lib/ajax/setuserpref.php?sesskey=' +
M.cfg.sesskey + '&pref=' + encodeURI(name) + '&value=' + encodeURI(value);
@@ -215,7 +215,7 @@ M.util.show_confirm_dialog = function(e, args) {
e.preventDefault();
}
YUI(M.yui.loader).use('yui2-container', 'yui2-event', function(Y) {
YUI().use('yui2-container', 'yui2-event', function(Y) {
var simpledialog = new YAHOO.widget.SimpleDialog('confirmdialog',
{width: '300px',
fixedcenter: true,
@@ -410,7 +410,7 @@ M.util.init_select_autosubmit = function(Y, formid, selectid, nothing) {
* Attach handler to url_select
*/
M.util.init_url_select = function(Y, formid, selectid, nothing) {
YUI(M.yui.loader).use('node', function(Y) {
YUI().use('node', function(Y) {
Y.on('change', function() {
if ((nothing == false && Y.Lang.isBoolean(nothing)) || Y.one('#'+selectid).get('value') != nothing) {
window.location = M.cfg.wwwroot+Y.one('#'+selectid).get('value');