Fix for issue 5044: Adding tabindex attributes for add contact dropdown and contents, also binding keypress event to perform same action that click does.

This commit is contained in:
khall 2014-08-24 21:37:39 -07:00
parent e0c836c03d
commit 049e504ad3
4 changed files with 6 additions and 4 deletions

View file

@ -12,7 +12,8 @@ app.views.AspectMembershipBlueprint = Backbone.View.extend({
var selector = '.dropdown.aspect_membership .dropdown_list > li'; var selector = '.dropdown.aspect_membership .dropdown_list > li';
$('body') $('body')
.off('click', selector) .off('click', selector)
.on('click', selector, _.bind(this._clickHandler, this)); .on('click', selector, _.bind(this._clickHandler, this))
.on('keypress', selector, _.bind(this._clickHandler, this));
this.list_item = null; this.list_item = null;
this.dropdown = null; this.dropdown = null;

View file

@ -21,7 +21,8 @@ var View = {
/* Dropdowns */ /* Dropdowns */
$(document) $(document)
.on('click', this.dropdowns.selector, this.dropdowns.click); .on('click', this.dropdowns.selector, this.dropdowns.click)
.on('keypress', this.dropdowns.selector, this.dropdowns.click);
/* Avatars */ /* Avatars */
$(this.avatars.selector).error(this.avatars.fallback); $(this.avatars.selector).error(this.avatars.fallback);

View file

@ -33,7 +33,7 @@ module AspectGlobalHelper
klass = am_id.present? ? "selected" : "" klass = am_id.present? ? "selected" : ""
str = <<LISTITEM str = <<LISTITEM
<li data-aspect_id="#{aspect.id}" data-membership_id="#{am_id}" class="#{klass} aspect_selector"> <li data-aspect_id="#{aspect.id}" data-membership_id="#{am_id}" class="#{klass} aspect_selector" tabindex="0">
#{aspect.name} #{aspect.name}
</li> </li>
LISTITEM LISTITEM

View file

@ -1,5 +1,5 @@
.dropdown{:class => ["hang_#{hang}", defined?(dropdown_class) && dropdown_class]} .dropdown{:class => ["hang_#{hang}", defined?(dropdown_class) && dropdown_class]}
.button.toggle{:class => ("in_aspects" if selected_aspects.size > 0)} .button.toggle{:class => ("in_aspects" if selected_aspects.size > 0), :tabindex => '0'}
- if selected_aspects.size == all_aspects.size - if selected_aspects.size == all_aspects.size
= t('all_aspects') = t('all_aspects')
- elsif selected_aspects.size == 1 - elsif selected_aspects.size == 1