Commit 1bb15dcd authored by Aaron Wells's avatar Aaron Wells

Hide accessibility link on drag-and-drop.

Bug 1443770. Note this solution doesn't work fully in IE10.
In that browser, the keyboard nav works, but clicking on the
thumbnail won't pop open the accessibility links.

The fix for that, is ultimately to change this from using
MochiKit to using JQuery.

Change-Id: I5f173f6b32a3a301c10262cd71838f78821b36dd
parent caa28af8
......@@ -479,12 +479,12 @@ function FileBrowser(idprefix, folderid, config, globalconfig) {
if (elemid != moveid) {
var displaytitle = title.find('.display-title').html();
var link = $j('<a>').attr('href', '#').html(get_string('moveto', displaytitle));
link.on('mousedown keydown', function(e) {
if (e.type == 'mousedown' && e.buttons == 0) {
link.on('click keydown', function(e) {
if (e.type == 'click' && e.buttons == 0) {
// Stops the link being activated when it shouldn't (eg. when setting focus to the list)
return false;
}
else if (e.type == 'mousedown' || e.keyCode == 32 || e.keyCode == 13) {
else if (e.type == 'click' || e.keyCode == 32 || e.keyCode == 13) {
self.setfocus = 'changefolder:' + elemid;
self.move_to_folder(moveid, elemid);
self.move_list = null;
......@@ -522,8 +522,8 @@ function FileBrowser(idprefix, folderid, config, globalconfig) {
this.make_icon_keyboard_accessible = function(icon) {
var self = this;
var id = icon.id.replace(/.+:/, '');
$j(icon).on('mousedown keydown', function(e) {
if (e.type == 'mousedown' || e.keyCode == 32 || e.keyCode == 13) {
$j(icon).on('click keydown', function(e) {
if (e.type == 'click' || e.keyCode == 32 || e.keyCode == 13) {
var folderlist = self.create_move_list(icon, id);
if (folderlist != '') {
$j(icon).closest('tr').find('.filename').append(folderlist);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment