mirror of
https://github.com/moodle/moodle.git
synced 2025-07-23 23:31:58 +02:00
MDL-20204 the ultimate fix for our frames (theyare not accessbile, but anyway); instead of adding the target to each element when creating html we use yui to set the target from page footer via JS - this fixes the links and forms in all elements in pages with frametop layout
This commit is contained in:
@@ -385,28 +385,40 @@ M.util.init_maximised_embed = function(Y, id) {
|
||||
* Attach handler to single_select
|
||||
*/
|
||||
M.util.init_select_autosubmit = 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);
|
||||
});
|
||||
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);
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Attach handler to url_select
|
||||
*/
|
||||
M.util.init_url_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) {
|
||||
window.location = M.cfg.wwwroot+Y.one('#'+selectid).get('value');
|
||||
}
|
||||
},
|
||||
'#'+selectid);
|
||||
});
|
||||
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) {
|
||||
window.location = M.cfg.wwwroot+Y.one('#'+selectid).get('value');
|
||||
}
|
||||
},
|
||||
'#'+selectid);
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Breaks out all links to the top frame - used in frametop page layout.
|
||||
*/
|
||||
M.util.init_frametop = function(Y) {
|
||||
Y.all('a').each(function(node) {
|
||||
node.set('target', '_top');
|
||||
});
|
||||
Y.all('form').each(function(node) {
|
||||
node.set('target', '_top');
|
||||
});
|
||||
};
|
||||
|
||||
//=== old legacy JS code, hopefully to be replaced soon by M.xx.yy and YUI3 code ===
|
||||
|
Reference in New Issue
Block a user