mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-29 16:19:58 +09:00
Install data-toggle function bugfix.
git-svn-id: http://xe-core.googlecode.com/svn/branches/maserati@12271 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
40dd5276c5
commit
c71e918121
1 changed files with 9 additions and 4 deletions
|
|
@ -2,12 +2,17 @@ jQuery(function($){
|
|||
// TARGET toggle
|
||||
$(document.body).on('click', '.x [data-toggle]', function(){
|
||||
var $this = $(this);
|
||||
if($this.is('a') && $this.attr('href') != $this.attr('data-toggle')){
|
||||
var target = $this.attr('href');
|
||||
$this.attr('data-toggle', target);
|
||||
}
|
||||
var $target = $($this.attr('data-toggle'));
|
||||
var focusable = 'a,input,button,textarea,select';
|
||||
$target.toggle();
|
||||
if($target.is(':visible') && !$target.find('a,input,button,textarea,select').length){
|
||||
$target.attr('tabindex','0').focus();
|
||||
} else if($target.is(':visible') && $target.find('a,input,button,textarea,select').length) {
|
||||
$target.find('a,input,button,textarea,select').eq(0).focus();
|
||||
if($target.is(':visible') && !$target.find(focusable).length){
|
||||
$target.not(':disabled').attr('tabindex','0').css('outline','0').focus();
|
||||
} else if($target.is(':visible') && $target.find(focusable).length) {
|
||||
$target.not(':disabled').find(focusable).eq(0).focus();
|
||||
} else {
|
||||
$this.focus();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue