Issue 2589 fixed. Create 'label[for]' and 'input[id]' attributes and matching the value.

git-svn-id: http://xe-core.googlecode.com/svn/branches/maserati@11736 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
ChanMyeong 2012-10-16 07:51:55 +00:00
parent 8c03891dae
commit e72e9809ee
4 changed files with 1484 additions and 47 deletions

View file

@ -60,6 +60,9 @@ body>.x,.x label,.x table,.x input,.x textarea,.x select,.x button{font-size:13p
.x .x_inline{display:inline-block;*display:inline;*zoom:1}
.x label[for],
.x .x_form-horizontal .x_control-label{font-weight:bold}
.x input[type="radio"]+label,
.x input[type="checkbox"]+label{font-weight:normal}
.x input:checked+label{font-weight:bold}
.x label.x_inline{margin-right:16px}
.x .x_input-append .x_add-on,
.x .x_input-prepend .x_add-on{height:16px;line-height:16px}

View file

@ -60,6 +60,9 @@ body>.x,.x label,.x table,.x input,.x textarea,.x select,.x button{font-size:13p
.x .x_inline{display:inline-block;*display:inline;*zoom:1}
.x label[for],
.x .x_form-horizontal .x_control-label{font-weight:bold}
.x input[type="radio"]+label,
.x input[type="checkbox"]+label{font-weight:normal}
.x input:checked+label{font-weight:bold}
.x label.x_inline{margin-right:16px}
.x .x_input-append .x_add-on,
.x .x_input-prepend .x_add-on{height:16px;line-height:16px}

View file

@ -150,6 +150,24 @@ jQuery(function($){
$this.addClass('vr');
}
});
// label[for] + input[id]/textarea[id]/select[id] creator
$('label:not([for])').each(function(index){
var $this = $(this);
index = index + 1;
if($this.next('input[id], textarea[id], select[id]').not(':radio, :checkbox').length){
// next input, textarea, select id true
$this.attr('for', $this.next().attr('id'));
} else if ($this.next('input:not([id]), textarea:not([id]), select:not([id])').not(':radio, :checkbox').length) {
// next input, textarea, select id false
$this.attr('for', 'i' + index).next().attr('id', 'i' + index);
} else if ($this.prev(':radio[id], :checkbox[id]').length) {
// prev :radio :checkbox id true
$this.attr('for', $this.prev().attr('id'));
} else if ($this.prev(':radio:not([id]), :checkbox:not([id])').length) {
// prev :radio :checkbox id false
$this.attr('for', 'i' + index).prev().attr('id', 'i' + index);
}
});
});
// Modal Window
jQuery(function($){

File diff suppressed because it is too large Load diff