mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-26 06:39:56 +09:00
issue 749 fixed filebox ux error
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9989 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
d523bc8f7a
commit
6c7df0c23e
2 changed files with 12 additions and 8 deletions
|
|
@ -85,7 +85,7 @@ function addRow(ulId){
|
|||
var $ = jQuery;
|
||||
var count = $('#'+ulId).children().length;
|
||||
var clone = $('#'+ulId).find('li:last-child').prev().clone();
|
||||
$('#'+ulId).find('li:last-child').prev().find('.__addBtn').remove();
|
||||
$('#'+ulId).find('li:last-child').prev().find('.__addBtn').hide();
|
||||
|
||||
clone.find('input[name^="attribute_name"]').attr("name", "attribute_name"+count).attr('value', '')
|
||||
.attr("id", "attribute_name"+count)
|
||||
|
|
@ -93,15 +93,19 @@ function addRow(ulId){
|
|||
clone.find('input[name^="attribute_value"]').attr("name", "attribute_value"+count).attr('value', '')
|
||||
.attr("id", "attribute_value"+count)
|
||||
.prev('label').attr('for', 'attribute_value'+count);
|
||||
clone.find('.__deleteBtn').attr("href", "javascript:clearRow('fileUp', "+count+")");
|
||||
|
||||
$('#'+ulId).find('li:last-child').before(clone);
|
||||
}
|
||||
|
||||
function clearRow(ulId,rowNumber){
|
||||
function clearRow(target){
|
||||
var $ = jQuery;
|
||||
var count = $('#'+ulId).children().length - 1;
|
||||
if (count <= 1) return;
|
||||
var ulTag = $(target).closest('ul');
|
||||
var count = ulTag.children().length - 1;
|
||||
if (count <= 1){
|
||||
ulTag.find('li:last-child').prev().find('.__addBtn').show();
|
||||
return;
|
||||
}
|
||||
|
||||
$('#'+ulId).find('input[name="attribute_name'+rowNumber+'"]').parent().remove();
|
||||
$(target).closest('li').remove();
|
||||
ulTag.find('li:last-child').prev().find('.__addBtn').show();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue