mirror of
https://github.com/moodle/moodle.git
synced 2025-07-13 18:36:34 +02:00
MDL-49811 lib: Added js to skiplinks
I have added a JS module to handle skiplinks to send the focus to the end of the block. This improves the function and allows the user to better tab through the page.
This commit is contained in:
@ -1828,3 +1828,17 @@ M.util.load_flowplayer = function() {
|
||||
document.getElementsByTagName('head')[0].appendChild(fileref);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Initiates the listeners for skiplink interaction
|
||||
*
|
||||
* @param {YUI} Y
|
||||
*/
|
||||
M.util.init_skiplink = function(Y) {
|
||||
Y.one(Y.config.doc.body).delegate('click', function(e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
Y.one(this.getAttribute('data-target')).focus();
|
||||
return true;
|
||||
}, 'a.skip');
|
||||
};
|
||||
|
Reference in New Issue
Block a user