data-toggle, data-show, data-hide JS function enhancement.

board module UI enhancement.

git-svn-id: http://xe-core.googlecode.com/svn/branches/maserati@12219 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
ChanMyeong 2012-11-14 09:38:42 +00:00
parent 66e2363b43
commit f9ca200edf
8 changed files with 23 additions and 7 deletions

View file

@ -45,6 +45,10 @@ 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();
@ -59,12 +63,21 @@ jQuery(function($){
});
// TARGET show
$(document.body).on('click', '.x [data-show]', function(){
$($(this).attr('data-show')).show().attr('tabindex','0').focus();
var $this = $(this);
if($this.is('a') && $this.attr('href') != $this.attr('data-show')){
var target = $this.attr('href');
$this.attr('data-show', target);
}
$($this.attr('data-show')).show().attr('tabindex','0').focus();
return false;
});
// TARGET hide
$(document.body).on('click', '.x [data-hide]', function(){
var $this = $(this);
if($this.is('a') && $this.attr('href') != $this.attr('data-hide')){
var target = $this.attr('href');
$this.attr('data-hide', target);
}
$($this.attr('data-hide')).hide();
$this.focus();
return false;

File diff suppressed because one or more lines are too long