|
|
@ -29,6 +29,11 @@ |
|
|
|
//= require mousetrap
|
|
|
|
//= require mousetrap
|
|
|
|
|
|
|
|
|
|
|
|
(function($){ |
|
|
|
(function($){ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var accessibleListSelector = "table.list, table.keyboard-accessible-list"; |
|
|
|
|
|
|
|
var accessibleRowSelector = "table.list tr, table.keyboard-accessible-list tr"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var menu_sidebar = function() { |
|
|
|
var menu_sidebar = function() { |
|
|
|
return $('div#menu-sidebar'); |
|
|
|
return $('div#menu-sidebar'); |
|
|
|
}; |
|
|
|
}; |
|
|
@ -130,7 +135,7 @@ |
|
|
|
var find_list_in_page = function(){ |
|
|
|
var find_list_in_page = function(){ |
|
|
|
var dom_lists, focus_elements; |
|
|
|
var dom_lists, focus_elements; |
|
|
|
focus_elements = []; |
|
|
|
focus_elements = []; |
|
|
|
dom_lists = $('table.list'); |
|
|
|
dom_lists = $(accessibleListSelector); |
|
|
|
dom_lists.find('tbody tr').each(function(index, tr){ |
|
|
|
dom_lists.find('tbody tr').each(function(index, tr){ |
|
|
|
var first_link = $(tr).find('a:visible')[0]; |
|
|
|
var first_link = $(tr).find('a:visible')[0]; |
|
|
|
if ( first_link !== undefined ) { focus_elements.push(first_link); } |
|
|
|
if ( first_link !== undefined ) { focus_elements.push(first_link); } |
|
|
@ -142,7 +147,7 @@ |
|
|
|
var list, index; |
|
|
|
var list, index; |
|
|
|
list = find_list_in_page(); |
|
|
|
list = find_list_in_page(); |
|
|
|
if (list === null) { return; } |
|
|
|
if (list === null) { return; } |
|
|
|
index = list.indexOf($(document.activeElement).parents('table.list tr').find('a:visible')[0]); |
|
|
|
index = list.indexOf($(document.activeElement).parents(accessibleRowSelector).find('a:visible')[0]); |
|
|
|
$(list[(index+offset+list.length) % list.length]).focus(); |
|
|
|
$(list[(index+offset+list.length) % list.length]).focus(); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
@ -175,16 +180,18 @@ |
|
|
|
|
|
|
|
|
|
|
|
Mousetrap.bind('p', function(){ search_project(); return false; }); |
|
|
|
Mousetrap.bind('p', function(){ search_project(); return false; }); |
|
|
|
Mousetrap.bind('s', function(){ search_global(); return false; }); |
|
|
|
Mousetrap.bind('s', function(){ search_global(); return false; }); |
|
|
|
})(jQuery); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
jQuery(function(){ |
|
|
|
jQuery(function(){ |
|
|
|
// simulated hover effect on table lists when using the keyboard
|
|
|
|
// simulated hover effect on table lists when using the keyboard
|
|
|
|
var tables = jQuery('table.list'); |
|
|
|
var tables = jQuery(accessibleListSelector); |
|
|
|
if (tables.size() === 0) { return; } |
|
|
|
if (tables.size() === 0) { return; } |
|
|
|
tables.on('blur', 'tr *', function(){ |
|
|
|
tables.on('blur', 'tr *', function(){ |
|
|
|
jQuery(this).parents('table.list tr').removeClass('keyboard_hover'); |
|
|
|
jQuery(this).parents(accessibleRowSelector).removeClass('keyboard_hover'); |
|
|
|
}); |
|
|
|
}); |
|
|
|
tables.on('focus', 'tr *', function(){ |
|
|
|
tables.on('focus', 'tr *', function(){ |
|
|
|
jQuery(this).parents('table.list tr').addClass('keyboard_hover'); |
|
|
|
jQuery(this).parents(accessibleRowSelector).addClass('keyboard_hover'); |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
})(jQuery); |
|
|
|
|
|
|
|
|
|
|
|