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:
Petr Skoda
2010-02-11 13:27:02 +00:00
parent ae6b463442
commit 4aea3cc7cd
24 changed files with 59 additions and 100 deletions

View File

@@ -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 ===