Skip to content

Commit

Permalink
MDL-42752 File-picker: Fix tabbing to disabled icons
Browse files Browse the repository at this point in the history
  • Loading branch information
jsnfwlr committed Jul 4, 2014
1 parent 7a4832e commit a34f0a4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
6 changes: 3 additions & 3 deletions files/renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -602,13 +602,13 @@ private function fp_js_template_generallayout() {
<div class="fp-tb-message"></div>
</div>
<div class="fp-viewbar">
<a title="'. get_string('displayicons', 'repository') .'" class="fp-vb-icons" href="#">
<a role="button" title="'. get_string('displayicons', 'repository') .'" class="fp-vb-icons" href="#">
<img alt="" src="'. $this->pix_url('fp/view_icon_active', 'theme') .'" />
</a>
<a title="'. get_string('displaydetails', 'repository') .'" class="fp-vb-details" href="#">
<a role="button" title="'. get_string('displaydetails', 'repository') .'" class="fp-vb-details" href="#">
<img alt="" src="'. $this->pix_url('fp/view_list_active', 'theme') .'" />
</a>
<a title="'. get_string('displaytree', 'repository') .'" class="fp-vb-tree" href="#">
<a role="button" title="'. get_string('displaytree', 'repository') .'" class="fp-vb-tree" href="#">
<img alt="" src="'. $this->pix_url('fp/view_tree_active', 'theme') .'" />
</a>
</div>
Expand Down
10 changes: 7 additions & 3 deletions repository/filepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -1266,12 +1266,16 @@ M.core_filepicker.init = function(Y, options) {
var viewbar = this.fpnode.one('.fp-viewbar')
if (viewbar) {
if (mode) {
viewbar.addClass('enabled').removeClass('disabled')
viewbar.addClass('enabled').removeClass('disabled');
this.fpnode.all('.fp-vb-icons,.fp-vb-tree,.fp-vb-details').setAttribute("aria-disabled", "false");
this.fpnode.all('.fp-vb-icons,.fp-vb-tree,.fp-vb-details').setAttribute("tabindex", "");
} else {
viewbar.removeClass('enabled').addClass('disabled')
viewbar.removeClass('enabled').addClass('disabled');
this.fpnode.all('.fp-vb-icons,.fp-vb-tree,.fp-vb-details').setAttribute("aria-disabled", "true");
this.fpnode.all('.fp-vb-icons,.fp-vb-tree,.fp-vb-details').setAttribute("tabindex", "-1");
}
}
this.fpnode.all('.fp-vb-icons,.fp-vb-tree,.fp-vb-details').removeClass('checked')
this.fpnode.all('.fp-vb-icons,.fp-vb-tree,.fp-vb-details').removeClass('checked');
var modes = {1:'icons', 2:'tree', 3:'details'};
this.fpnode.all('.fp-vb-'+modes[this.viewmode]).addClass('checked');
},
Expand Down

0 comments on commit a34f0a4

Please sign in to comment.